1#![doc = "MAVLink uAvionix dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
21#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22#[cfg_attr(feature = "serde", serde(tag = "type"))]
23#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24#[repr(u32)]
25#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
26pub enum ActuatorConfiguration {
27 #[doc = "Do nothing."]
28 ACTUATOR_CONFIGURATION_NONE = 0,
29 #[doc = "Command the actuator to beep now."]
30 ACTUATOR_CONFIGURATION_BEEP = 1,
31 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
32 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
33 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
34 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
35 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
36 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
37 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
38 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
39}
40impl ActuatorConfiguration {
41 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
42}
43impl Default for ActuatorConfiguration {
44 fn default() -> Self {
45 Self::DEFAULT
46 }
47}
48#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
49#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
50#[cfg_attr(feature = "serde", serde(tag = "type"))]
51#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
52#[repr(u32)]
53#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
54pub enum ActuatorOutputFunction {
55 #[doc = "No function (disabled)."]
56 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
57 #[doc = "Motor 1"]
58 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
59 #[doc = "Motor 2"]
60 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
61 #[doc = "Motor 3"]
62 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
63 #[doc = "Motor 4"]
64 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
65 #[doc = "Motor 5"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
67 #[doc = "Motor 6"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
69 #[doc = "Motor 7"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
71 #[doc = "Motor 8"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
73 #[doc = "Motor 9"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
75 #[doc = "Motor 10"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
77 #[doc = "Motor 11"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
79 #[doc = "Motor 12"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
81 #[doc = "Motor 13"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
83 #[doc = "Motor 14"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
85 #[doc = "Motor 15"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
87 #[doc = "Motor 16"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
89 #[doc = "Servo 1"]
90 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
91 #[doc = "Servo 2"]
92 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
93 #[doc = "Servo 3"]
94 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
95 #[doc = "Servo 4"]
96 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
97 #[doc = "Servo 5"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
99 #[doc = "Servo 6"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
101 #[doc = "Servo 7"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
103 #[doc = "Servo 8"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
105 #[doc = "Servo 9"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
107 #[doc = "Servo 10"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
109 #[doc = "Servo 11"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
111 #[doc = "Servo 12"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
113 #[doc = "Servo 13"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
115 #[doc = "Servo 14"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
117 #[doc = "Servo 15"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
119 #[doc = "Servo 16"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
121}
122impl ActuatorOutputFunction {
123 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
124}
125impl Default for ActuatorOutputFunction {
126 fn default() -> Self {
127 Self::DEFAULT
128 }
129}
130#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
131#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
132#[cfg_attr(feature = "serde", serde(tag = "type"))]
133#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
134#[repr(u32)]
135#[doc = "Enumeration of the ADSB altimeter types"]
136pub enum AdsbAltitudeType {
137 #[doc = "Altitude reported from a Baro source using QNH reference"]
138 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
139 #[doc = "Altitude reported from a GNSS source"]
140 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
141}
142impl AdsbAltitudeType {
143 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
144}
145impl Default for AdsbAltitudeType {
146 fn default() -> Self {
147 Self::DEFAULT
148 }
149}
150#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
152#[cfg_attr(feature = "serde", serde(tag = "type"))]
153#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
154#[repr(u32)]
155#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
156pub enum AdsbEmitterType {
157 ADSB_EMITTER_TYPE_NO_INFO = 0,
158 ADSB_EMITTER_TYPE_LIGHT = 1,
159 ADSB_EMITTER_TYPE_SMALL = 2,
160 ADSB_EMITTER_TYPE_LARGE = 3,
161 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
162 ADSB_EMITTER_TYPE_HEAVY = 5,
163 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
164 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
165 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
166 ADSB_EMITTER_TYPE_GLIDER = 9,
167 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
168 ADSB_EMITTER_TYPE_PARACHUTE = 11,
169 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
170 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
171 ADSB_EMITTER_TYPE_UAV = 14,
172 ADSB_EMITTER_TYPE_SPACE = 15,
173 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
174 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
175 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
176 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
177}
178impl AdsbEmitterType {
179 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
180}
181impl Default for AdsbEmitterType {
182 fn default() -> Self {
183 Self::DEFAULT
184 }
185}
186bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
187impl AdsbFlags {
188 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
189}
190impl Default for AdsbFlags {
191 fn default() -> Self {
192 Self::DEFAULT
193 }
194}
195bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
196impl AisFlags {
197 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
198}
199impl Default for AisFlags {
200 fn default() -> Self {
201 Self::DEFAULT
202 }
203}
204#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
206#[cfg_attr(feature = "serde", serde(tag = "type"))]
207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
208#[repr(u32)]
209#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
210pub enum AisNavStatus {
211 #[doc = "Under way using engine."]
212 UNDER_WAY = 0,
213 AIS_NAV_ANCHORED = 1,
214 AIS_NAV_UN_COMMANDED = 2,
215 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
216 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
217 AIS_NAV_MOORED = 5,
218 AIS_NAV_AGROUND = 6,
219 AIS_NAV_FISHING = 7,
220 AIS_NAV_SAILING = 8,
221 AIS_NAV_RESERVED_HSC = 9,
222 AIS_NAV_RESERVED_WIG = 10,
223 AIS_NAV_RESERVED_1 = 11,
224 AIS_NAV_RESERVED_2 = 12,
225 AIS_NAV_RESERVED_3 = 13,
226 #[doc = "Search And Rescue Transponder."]
227 AIS_NAV_AIS_SART = 14,
228 #[doc = "Not available (default)."]
229 AIS_NAV_UNKNOWN = 15,
230}
231impl AisNavStatus {
232 pub const DEFAULT: Self = Self::UNDER_WAY;
233}
234impl Default for AisNavStatus {
235 fn default() -> Self {
236 Self::DEFAULT
237 }
238}
239#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
241#[cfg_attr(feature = "serde", serde(tag = "type"))]
242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
243#[repr(u32)]
244#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
245pub enum AisType {
246 #[doc = "Not available (default)."]
247 AIS_TYPE_UNKNOWN = 0,
248 AIS_TYPE_RESERVED_1 = 1,
249 AIS_TYPE_RESERVED_2 = 2,
250 AIS_TYPE_RESERVED_3 = 3,
251 AIS_TYPE_RESERVED_4 = 4,
252 AIS_TYPE_RESERVED_5 = 5,
253 AIS_TYPE_RESERVED_6 = 6,
254 AIS_TYPE_RESERVED_7 = 7,
255 AIS_TYPE_RESERVED_8 = 8,
256 AIS_TYPE_RESERVED_9 = 9,
257 AIS_TYPE_RESERVED_10 = 10,
258 AIS_TYPE_RESERVED_11 = 11,
259 AIS_TYPE_RESERVED_12 = 12,
260 AIS_TYPE_RESERVED_13 = 13,
261 AIS_TYPE_RESERVED_14 = 14,
262 AIS_TYPE_RESERVED_15 = 15,
263 AIS_TYPE_RESERVED_16 = 16,
264 AIS_TYPE_RESERVED_17 = 17,
265 AIS_TYPE_RESERVED_18 = 18,
266 AIS_TYPE_RESERVED_19 = 19,
267 #[doc = "Wing In Ground effect."]
268 AIS_TYPE_WIG = 20,
269 AIS_TYPE_WIG_HAZARDOUS_A = 21,
270 AIS_TYPE_WIG_HAZARDOUS_B = 22,
271 AIS_TYPE_WIG_HAZARDOUS_C = 23,
272 AIS_TYPE_WIG_HAZARDOUS_D = 24,
273 AIS_TYPE_WIG_RESERVED_1 = 25,
274 AIS_TYPE_WIG_RESERVED_2 = 26,
275 AIS_TYPE_WIG_RESERVED_3 = 27,
276 AIS_TYPE_WIG_RESERVED_4 = 28,
277 AIS_TYPE_WIG_RESERVED_5 = 29,
278 AIS_TYPE_FISHING = 30,
279 AIS_TYPE_TOWING = 31,
280 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
281 AIS_TYPE_TOWING_LARGE = 32,
282 #[doc = "Dredging or other underwater ops."]
283 AIS_TYPE_DREDGING = 33,
284 AIS_TYPE_DIVING = 34,
285 AIS_TYPE_MILITARY = 35,
286 AIS_TYPE_SAILING = 36,
287 AIS_TYPE_PLEASURE = 37,
288 AIS_TYPE_RESERVED_20 = 38,
289 AIS_TYPE_RESERVED_21 = 39,
290 #[doc = "High Speed Craft."]
291 AIS_TYPE_HSC = 40,
292 AIS_TYPE_HSC_HAZARDOUS_A = 41,
293 AIS_TYPE_HSC_HAZARDOUS_B = 42,
294 AIS_TYPE_HSC_HAZARDOUS_C = 43,
295 AIS_TYPE_HSC_HAZARDOUS_D = 44,
296 AIS_TYPE_HSC_RESERVED_1 = 45,
297 AIS_TYPE_HSC_RESERVED_2 = 46,
298 AIS_TYPE_HSC_RESERVED_3 = 47,
299 AIS_TYPE_HSC_RESERVED_4 = 48,
300 AIS_TYPE_HSC_UNKNOWN = 49,
301 AIS_TYPE_PILOT = 50,
302 #[doc = "Search And Rescue vessel."]
303 AIS_TYPE_SAR = 51,
304 AIS_TYPE_TUG = 52,
305 AIS_TYPE_PORT_TENDER = 53,
306 #[doc = "Anti-pollution equipment."]
307 AIS_TYPE_ANTI_POLLUTION = 54,
308 AIS_TYPE_LAW_ENFORCEMENT = 55,
309 AIS_TYPE_SPARE_LOCAL_1 = 56,
310 AIS_TYPE_SPARE_LOCAL_2 = 57,
311 AIS_TYPE_MEDICAL_TRANSPORT = 58,
312 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
313 AIS_TYPE_NONECOMBATANT = 59,
314 AIS_TYPE_PASSENGER = 60,
315 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
316 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
317 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
318 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
319 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
320 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
321 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
322 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
323 AIS_TYPE_PASSENGER_UNKNOWN = 69,
324 AIS_TYPE_CARGO = 70,
325 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
326 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
327 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
328 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
329 AIS_TYPE_CARGO_RESERVED_1 = 75,
330 AIS_TYPE_CARGO_RESERVED_2 = 76,
331 AIS_TYPE_CARGO_RESERVED_3 = 77,
332 AIS_TYPE_CARGO_RESERVED_4 = 78,
333 AIS_TYPE_CARGO_UNKNOWN = 79,
334 AIS_TYPE_TANKER = 80,
335 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
336 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
337 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
338 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
339 AIS_TYPE_TANKER_RESERVED_1 = 85,
340 AIS_TYPE_TANKER_RESERVED_2 = 86,
341 AIS_TYPE_TANKER_RESERVED_3 = 87,
342 AIS_TYPE_TANKER_RESERVED_4 = 88,
343 AIS_TYPE_TANKER_UNKNOWN = 89,
344 AIS_TYPE_OTHER = 90,
345 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
346 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
347 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
348 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
349 AIS_TYPE_OTHER_RESERVED_1 = 95,
350 AIS_TYPE_OTHER_RESERVED_2 = 96,
351 AIS_TYPE_OTHER_RESERVED_3 = 97,
352 AIS_TYPE_OTHER_RESERVED_4 = 98,
353 AIS_TYPE_OTHER_UNKNOWN = 99,
354}
355impl AisType {
356 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
357}
358impl Default for AisType {
359 fn default() -> Self {
360 Self::DEFAULT
361 }
362}
363bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
364impl AttitudeTargetTypemask {
365 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
366}
367impl Default for AttitudeTargetTypemask {
368 fn default() -> Self {
369 Self::DEFAULT
370 }
371}
372#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
374#[cfg_attr(feature = "serde", serde(tag = "type"))]
375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
376#[repr(u32)]
377#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
378pub enum AutotuneAxis {
379 #[doc = "Autotune roll axis."]
380 AUTOTUNE_AXIS_ROLL = 1,
381 #[doc = "Autotune pitch axis."]
382 AUTOTUNE_AXIS_PITCH = 2,
383 #[doc = "Autotune yaw axis."]
384 AUTOTUNE_AXIS_YAW = 4,
385}
386impl AutotuneAxis {
387 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
388}
389impl Default for AutotuneAxis {
390 fn default() -> Self {
391 Self::DEFAULT
392 }
393}
394bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
395impl CameraCapFlags {
396 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
397}
398impl Default for CameraCapFlags {
399 fn default() -> Self {
400 Self::DEFAULT
401 }
402}
403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
405#[cfg_attr(feature = "serde", serde(tag = "type"))]
406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
407#[repr(u32)]
408#[doc = "Camera Modes."]
409pub enum CameraMode {
410 #[doc = "Camera is in image/photo capture mode."]
411 CAMERA_MODE_IMAGE = 0,
412 #[doc = "Camera is in video capture mode."]
413 CAMERA_MODE_VIDEO = 1,
414 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
415 CAMERA_MODE_IMAGE_SURVEY = 2,
416}
417impl CameraMode {
418 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
419}
420impl Default for CameraMode {
421 fn default() -> Self {
422 Self::DEFAULT
423 }
424}
425#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
427#[cfg_attr(feature = "serde", serde(tag = "type"))]
428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
429#[repr(u32)]
430#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
431pub enum CameraSource {
432 #[doc = "Default camera source."]
433 CAMERA_SOURCE_DEFAULT = 0,
434 #[doc = "RGB camera source."]
435 CAMERA_SOURCE_RGB = 1,
436 #[doc = "IR camera source."]
437 CAMERA_SOURCE_IR = 2,
438 #[doc = "NDVI camera source."]
439 CAMERA_SOURCE_NDVI = 3,
440}
441impl CameraSource {
442 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
443}
444impl Default for CameraSource {
445 fn default() -> Self {
446 Self::DEFAULT
447 }
448}
449#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
451#[cfg_attr(feature = "serde", serde(tag = "type"))]
452#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
453#[repr(u32)]
454#[doc = "Camera tracking modes"]
455pub enum CameraTrackingMode {
456 #[doc = "Not tracking"]
457 CAMERA_TRACKING_MODE_NONE = 0,
458 #[doc = "Target is a point"]
459 CAMERA_TRACKING_MODE_POINT = 1,
460 #[doc = "Target is a rectangle"]
461 CAMERA_TRACKING_MODE_RECTANGLE = 2,
462}
463impl CameraTrackingMode {
464 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
465}
466impl Default for CameraTrackingMode {
467 fn default() -> Self {
468 Self::DEFAULT
469 }
470}
471#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
473#[cfg_attr(feature = "serde", serde(tag = "type"))]
474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
475#[repr(u32)]
476#[doc = "Camera tracking status flags"]
477pub enum CameraTrackingStatusFlags {
478 #[doc = "Camera is not tracking"]
479 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
480 #[doc = "Camera is tracking"]
481 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
482 #[doc = "Camera tracking in error state"]
483 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
484}
485impl CameraTrackingStatusFlags {
486 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
487}
488impl Default for CameraTrackingStatusFlags {
489 fn default() -> Self {
490 Self::DEFAULT
491 }
492}
493bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
494impl CameraTrackingTargetData {
495 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
496}
497impl Default for CameraTrackingTargetData {
498 fn default() -> Self {
499 Self::DEFAULT
500 }
501}
502#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
504#[cfg_attr(feature = "serde", serde(tag = "type"))]
505#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
506#[repr(u32)]
507#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
508pub enum CameraZoomType {
509 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
510 ZOOM_TYPE_STEP = 0,
511 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
512 ZOOM_TYPE_CONTINUOUS = 1,
513 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
514 ZOOM_TYPE_RANGE = 2,
515 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
516 ZOOM_TYPE_FOCAL_LENGTH = 3,
517 #[doc = "Zoom value as horizontal field of view in degrees."]
518 ZOOM_TYPE_HORIZONTAL_FOV = 4,
519}
520impl CameraZoomType {
521 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
522}
523impl Default for CameraZoomType {
524 fn default() -> Self {
525 Self::DEFAULT
526 }
527}
528#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
530#[cfg_attr(feature = "serde", serde(tag = "type"))]
531#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
532#[repr(u32)]
533pub enum CanFilterOp {
534 CAN_FILTER_REPLACE = 0,
535 CAN_FILTER_ADD = 1,
536 CAN_FILTER_REMOVE = 2,
537}
538impl CanFilterOp {
539 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
540}
541impl Default for CanFilterOp {
542 fn default() -> Self {
543 Self::DEFAULT
544 }
545}
546#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
548#[cfg_attr(feature = "serde", serde(tag = "type"))]
549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
550#[repr(u32)]
551#[doc = "Possible responses from a CELLULAR_CONFIG message."]
552pub enum CellularConfigResponse {
553 #[doc = "Changes accepted."]
554 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
555 #[doc = "Invalid APN."]
556 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
557 #[doc = "Invalid PIN."]
558 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
559 #[doc = "Changes rejected."]
560 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
561 #[doc = "PUK is required to unblock SIM card."]
562 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
563}
564impl CellularConfigResponse {
565 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
566}
567impl Default for CellularConfigResponse {
568 fn default() -> Self {
569 Self::DEFAULT
570 }
571}
572#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
574#[cfg_attr(feature = "serde", serde(tag = "type"))]
575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
576#[repr(u32)]
577#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
578pub enum CellularNetworkFailedReason {
579 #[doc = "No error"]
580 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
581 #[doc = "Error state is unknown"]
582 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
583 #[doc = "SIM is required for the modem but missing"]
584 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
585 #[doc = "SIM is available, but not usable for connection"]
586 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
587}
588impl CellularNetworkFailedReason {
589 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
590}
591impl Default for CellularNetworkFailedReason {
592 fn default() -> Self {
593 Self::DEFAULT
594 }
595}
596#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
598#[cfg_attr(feature = "serde", serde(tag = "type"))]
599#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
600#[repr(u32)]
601#[doc = "Cellular network radio type"]
602pub enum CellularNetworkRadioType {
603 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
604 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
605 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
606 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
607 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
608}
609impl CellularNetworkRadioType {
610 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
611}
612impl Default for CellularNetworkRadioType {
613 fn default() -> Self {
614 Self::DEFAULT
615 }
616}
617#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
619#[cfg_attr(feature = "serde", serde(tag = "type"))]
620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
621#[repr(u32)]
622#[doc = "These flags encode the cellular network status"]
623pub enum CellularStatusFlag {
624 #[doc = "State unknown or not reportable."]
625 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
626 #[doc = "Modem is unusable"]
627 CELLULAR_STATUS_FLAG_FAILED = 1,
628 #[doc = "Modem is being initialized"]
629 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
630 #[doc = "Modem is locked"]
631 CELLULAR_STATUS_FLAG_LOCKED = 3,
632 #[doc = "Modem is not enabled and is powered down"]
633 CELLULAR_STATUS_FLAG_DISABLED = 4,
634 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
635 CELLULAR_STATUS_FLAG_DISABLING = 5,
636 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
637 CELLULAR_STATUS_FLAG_ENABLING = 6,
638 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
639 CELLULAR_STATUS_FLAG_ENABLED = 7,
640 #[doc = "Modem is searching for a network provider to register"]
641 CELLULAR_STATUS_FLAG_SEARCHING = 8,
642 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
643 CELLULAR_STATUS_FLAG_REGISTERED = 9,
644 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
645 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
646 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
647 CELLULAR_STATUS_FLAG_CONNECTING = 11,
648 #[doc = "One or more packet data bearers is active and connected"]
649 CELLULAR_STATUS_FLAG_CONNECTED = 12,
650}
651impl CellularStatusFlag {
652 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
653}
654impl Default for CellularStatusFlag {
655 fn default() -> Self {
656 Self::DEFAULT
657 }
658}
659#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
661#[cfg_attr(feature = "serde", serde(tag = "type"))]
662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
663#[repr(u32)]
664#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
665pub enum CompMetadataType {
666 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
667 COMP_METADATA_TYPE_GENERAL = 0,
668 #[doc = "Parameter meta data."]
669 COMP_METADATA_TYPE_PARAMETER = 1,
670 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
671 COMP_METADATA_TYPE_COMMANDS = 2,
672 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
673 COMP_METADATA_TYPE_PERIPHERALS = 3,
674 #[doc = "Meta data for the events interface."]
675 COMP_METADATA_TYPE_EVENTS = 4,
676 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
677 COMP_METADATA_TYPE_ACTUATORS = 5,
678}
679impl CompMetadataType {
680 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
681}
682impl Default for CompMetadataType {
683 fn default() -> Self {
684 Self::DEFAULT
685 }
686}
687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
689#[cfg_attr(feature = "serde", serde(tag = "type"))]
690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
691#[repr(u32)]
692#[doc = "Indicates the ESC connection type."]
693pub enum EscConnectionType {
694 #[doc = "Traditional PPM ESC."]
695 ESC_CONNECTION_TYPE_PPM = 0,
696 #[doc = "Serial Bus connected ESC."]
697 ESC_CONNECTION_TYPE_SERIAL = 1,
698 #[doc = "One Shot PPM ESC."]
699 ESC_CONNECTION_TYPE_ONESHOT = 2,
700 #[doc = "I2C ESC."]
701 ESC_CONNECTION_TYPE_I2C = 3,
702 #[doc = "CAN-Bus ESC."]
703 ESC_CONNECTION_TYPE_CAN = 4,
704 #[doc = "DShot ESC."]
705 ESC_CONNECTION_TYPE_DSHOT = 5,
706}
707impl EscConnectionType {
708 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
709}
710impl Default for EscConnectionType {
711 fn default() -> Self {
712 Self::DEFAULT
713 }
714}
715bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
716impl EscFailureFlags {
717 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
718}
719impl Default for EscFailureFlags {
720 fn default() -> Self {
721 Self::DEFAULT
722 }
723}
724bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
725impl EstimatorStatusFlags {
726 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
727}
728impl Default for EstimatorStatusFlags {
729 fn default() -> Self {
730 Self::DEFAULT
731 }
732}
733#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
735#[cfg_attr(feature = "serde", serde(tag = "type"))]
736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
737#[repr(u32)]
738#[doc = "List of possible failure type to inject."]
739pub enum FailureType {
740 #[doc = "No failure injected, used to reset a previous failure."]
741 FAILURE_TYPE_OK = 0,
742 #[doc = "Sets unit off, so completely non-responsive."]
743 FAILURE_TYPE_OFF = 1,
744 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
745 FAILURE_TYPE_STUCK = 2,
746 #[doc = "Unit is reporting complete garbage."]
747 FAILURE_TYPE_GARBAGE = 3,
748 #[doc = "Unit is consistently wrong."]
749 FAILURE_TYPE_WRONG = 4,
750 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
751 FAILURE_TYPE_SLOW = 5,
752 #[doc = "Data of unit is delayed in time."]
753 FAILURE_TYPE_DELAYED = 6,
754 #[doc = "Unit is sometimes working, sometimes not."]
755 FAILURE_TYPE_INTERMITTENT = 7,
756}
757impl FailureType {
758 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
759}
760impl Default for FailureType {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
767#[cfg_attr(feature = "serde", serde(tag = "type"))]
768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
769#[repr(u32)]
770#[doc = "List of possible units where failures can be injected."]
771pub enum FailureUnit {
772 FAILURE_UNIT_SENSOR_GYRO = 0,
773 FAILURE_UNIT_SENSOR_ACCEL = 1,
774 FAILURE_UNIT_SENSOR_MAG = 2,
775 FAILURE_UNIT_SENSOR_BARO = 3,
776 FAILURE_UNIT_SENSOR_GPS = 4,
777 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
778 FAILURE_UNIT_SENSOR_VIO = 6,
779 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
780 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
781 FAILURE_UNIT_SYSTEM_BATTERY = 100,
782 FAILURE_UNIT_SYSTEM_MOTOR = 101,
783 FAILURE_UNIT_SYSTEM_SERVO = 102,
784 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
785 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
786 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
787}
788impl FailureUnit {
789 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
790}
791impl Default for FailureUnit {
792 fn default() -> Self {
793 Self::DEFAULT
794 }
795}
796#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
797#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
798#[cfg_attr(feature = "serde", serde(tag = "type"))]
799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
800#[repr(u32)]
801pub enum FenceBreach {
802 #[doc = "No last fence breach"]
803 FENCE_BREACH_NONE = 0,
804 #[doc = "Breached minimum altitude"]
805 FENCE_BREACH_MINALT = 1,
806 #[doc = "Breached maximum altitude"]
807 FENCE_BREACH_MAXALT = 2,
808 #[doc = "Breached fence boundary"]
809 FENCE_BREACH_BOUNDARY = 3,
810}
811impl FenceBreach {
812 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
813}
814impl Default for FenceBreach {
815 fn default() -> Self {
816 Self::DEFAULT
817 }
818}
819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
821#[cfg_attr(feature = "serde", serde(tag = "type"))]
822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
823#[repr(u32)]
824#[doc = "Actions being taken to mitigate/prevent fence breach"]
825pub enum FenceMitigate {
826 #[doc = "Unknown"]
827 FENCE_MITIGATE_UNKNOWN = 0,
828 #[doc = "No actions being taken"]
829 FENCE_MITIGATE_NONE = 1,
830 #[doc = "Velocity limiting active to prevent breach"]
831 FENCE_MITIGATE_VEL_LIMIT = 2,
832}
833impl FenceMitigate {
834 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
835}
836impl Default for FenceMitigate {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
843#[cfg_attr(feature = "serde", serde(tag = "type"))]
844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
845#[repr(u32)]
846#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
847pub enum FenceType {
848 #[doc = "Maximum altitude fence"]
849 FENCE_TYPE_ALT_MAX = 1,
850 #[doc = "Circle fence"]
851 FENCE_TYPE_CIRCLE = 2,
852 #[doc = "Polygon fence"]
853 FENCE_TYPE_POLYGON = 4,
854 #[doc = "Minimum altitude fence"]
855 FENCE_TYPE_ALT_MIN = 8,
856}
857impl FenceType {
858 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
859}
860impl Default for FenceType {
861 fn default() -> Self {
862 Self::DEFAULT
863 }
864}
865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
867#[cfg_attr(feature = "serde", serde(tag = "type"))]
868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
869#[repr(u32)]
870#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
871pub enum FirmwareVersionType {
872 #[doc = "development release"]
873 FIRMWARE_VERSION_TYPE_DEV = 0,
874 #[doc = "alpha release"]
875 FIRMWARE_VERSION_TYPE_ALPHA = 64,
876 #[doc = "beta release"]
877 FIRMWARE_VERSION_TYPE_BETA = 128,
878 #[doc = "release candidate"]
879 FIRMWARE_VERSION_TYPE_RC = 192,
880 #[doc = "official stable release"]
881 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
882}
883impl FirmwareVersionType {
884 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
885}
886impl Default for FirmwareVersionType {
887 fn default() -> Self {
888 Self::DEFAULT
889 }
890}
891bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
892impl GimbalDeviceCapFlags {
893 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
894}
895impl Default for GimbalDeviceCapFlags {
896 fn default() -> Self {
897 Self::DEFAULT
898 }
899}
900bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
901impl GimbalDeviceErrorFlags {
902 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
903}
904impl Default for GimbalDeviceErrorFlags {
905 fn default() -> Self {
906 Self::DEFAULT
907 }
908}
909bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
910impl GimbalDeviceFlags {
911 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
912}
913impl Default for GimbalDeviceFlags {
914 fn default() -> Self {
915 Self::DEFAULT
916 }
917}
918bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
919impl GimbalManagerCapFlags {
920 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
921}
922impl Default for GimbalManagerCapFlags {
923 fn default() -> Self {
924 Self::DEFAULT
925 }
926}
927bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
928impl GimbalManagerFlags {
929 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
930}
931impl Default for GimbalManagerFlags {
932 fn default() -> Self {
933 Self::DEFAULT
934 }
935}
936#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
938#[cfg_attr(feature = "serde", serde(tag = "type"))]
939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
940#[repr(u32)]
941#[doc = "Type of GPS fix"]
942pub enum GpsFixType {
943 #[doc = "No GPS connected"]
944 GPS_FIX_TYPE_NO_GPS = 0,
945 #[doc = "No position information, GPS is connected"]
946 GPS_FIX_TYPE_NO_FIX = 1,
947 #[doc = "2D position"]
948 GPS_FIX_TYPE_2D_FIX = 2,
949 #[doc = "3D position"]
950 GPS_FIX_TYPE_3D_FIX = 3,
951 #[doc = "DGPS/SBAS aided 3D position"]
952 GPS_FIX_TYPE_DGPS = 4,
953 #[doc = "RTK float, 3D position"]
954 GPS_FIX_TYPE_RTK_FLOAT = 5,
955 #[doc = "RTK Fixed, 3D position"]
956 GPS_FIX_TYPE_RTK_FIXED = 6,
957 #[doc = "Static fixed, typically used for base stations"]
958 GPS_FIX_TYPE_STATIC = 7,
959 #[doc = "PPP, 3D position."]
960 GPS_FIX_TYPE_PPP = 8,
961}
962impl GpsFixType {
963 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
964}
965impl Default for GpsFixType {
966 fn default() -> Self {
967 Self::DEFAULT
968 }
969}
970bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
971impl GpsInputIgnoreFlags {
972 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
973}
974impl Default for GpsInputIgnoreFlags {
975 fn default() -> Self {
976 Self::DEFAULT
977 }
978}
979#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
980#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
981#[cfg_attr(feature = "serde", serde(tag = "type"))]
982#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
983#[repr(u32)]
984#[doc = "Gripper actions."]
985pub enum GripperActions {
986 #[doc = "Gripper release cargo."]
987 GRIPPER_ACTION_RELEASE = 0,
988 #[doc = "Gripper grab onto cargo."]
989 GRIPPER_ACTION_GRAB = 1,
990}
991impl GripperActions {
992 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
993}
994impl Default for GripperActions {
995 fn default() -> Self {
996 Self::DEFAULT
997 }
998}
999bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1000impl HighresImuUpdatedFlags {
1001 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1002}
1003impl Default for HighresImuUpdatedFlags {
1004 fn default() -> Self {
1005 Self::DEFAULT
1006 }
1007}
1008bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1009impl HilActuatorControlsFlags {
1010 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1011}
1012impl Default for HilActuatorControlsFlags {
1013 fn default() -> Self {
1014 Self::DEFAULT
1015 }
1016}
1017bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1018impl HilSensorUpdatedFlags {
1019 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1020}
1021impl Default for HilSensorUpdatedFlags {
1022 fn default() -> Self {
1023 Self::DEFAULT
1024 }
1025}
1026bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1027impl HlFailureFlag {
1028 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1029}
1030impl Default for HlFailureFlag {
1031 fn default() -> Self {
1032 Self::DEFAULT
1033 }
1034}
1035bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1036impl IlluminatorErrorFlags {
1037 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1038}
1039impl Default for IlluminatorErrorFlags {
1040 fn default() -> Self {
1041 Self::DEFAULT
1042 }
1043}
1044#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1045#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1046#[cfg_attr(feature = "serde", serde(tag = "type"))]
1047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1048#[repr(u32)]
1049#[doc = "Modes of illuminator"]
1050pub enum IlluminatorMode {
1051 #[doc = "Illuminator mode is not specified/unknown"]
1052 ILLUMINATOR_MODE_UNKNOWN = 0,
1053 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1054 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1055 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1056 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1057}
1058impl IlluminatorMode {
1059 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1060}
1061impl Default for IlluminatorMode {
1062 fn default() -> Self {
1063 Self::DEFAULT
1064 }
1065}
1066#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1068#[cfg_attr(feature = "serde", serde(tag = "type"))]
1069#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1070#[repr(u32)]
1071#[doc = "Type of landing target"]
1072pub enum LandingTargetType {
1073 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1074 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1075 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1076 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1077 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1078 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1079 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1080 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1081}
1082impl LandingTargetType {
1083 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1084}
1085impl Default for LandingTargetType {
1086 fn default() -> Self {
1087 Self::DEFAULT
1088 }
1089}
1090#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1092#[cfg_attr(feature = "serde", serde(tag = "type"))]
1093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1094#[repr(u32)]
1095pub enum MagCalStatus {
1096 MAG_CAL_NOT_STARTED = 0,
1097 MAG_CAL_WAITING_TO_START = 1,
1098 MAG_CAL_RUNNING_STEP_ONE = 2,
1099 MAG_CAL_RUNNING_STEP_TWO = 3,
1100 MAG_CAL_SUCCESS = 4,
1101 MAG_CAL_FAILED = 5,
1102 MAG_CAL_BAD_ORIENTATION = 6,
1103 MAG_CAL_BAD_RADIUS = 7,
1104}
1105impl MagCalStatus {
1106 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1107}
1108impl Default for MagCalStatus {
1109 fn default() -> Self {
1110 Self::DEFAULT
1111 }
1112}
1113#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1114#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1115#[cfg_attr(feature = "serde", serde(tag = "type"))]
1116#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1117#[repr(u32)]
1118pub enum MavArmAuthDeniedReason {
1119 #[doc = "Not a specific reason"]
1120 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1121 #[doc = "Authorizer will send the error as string to GCS"]
1122 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1123 #[doc = "At least one waypoint have a invalid value"]
1124 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1125 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1126 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1127 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1128 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1129 #[doc = "Weather is not good to fly"]
1130 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1131}
1132impl MavArmAuthDeniedReason {
1133 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1134}
1135impl Default for MavArmAuthDeniedReason {
1136 fn default() -> Self {
1137 Self::DEFAULT
1138 }
1139}
1140#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1141#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1142#[cfg_attr(feature = "serde", serde(tag = "type"))]
1143#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1144#[repr(u32)]
1145#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1146pub enum MavAutopilot {
1147 #[doc = "Generic autopilot, full support for everything"]
1148 MAV_AUTOPILOT_GENERIC = 0,
1149 #[doc = "Reserved for future use."]
1150 MAV_AUTOPILOT_RESERVED = 1,
1151 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1152 MAV_AUTOPILOT_SLUGS = 2,
1153 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1154 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1155 #[doc = "OpenPilot, <http://openpilot.org>"]
1156 MAV_AUTOPILOT_OPENPILOT = 4,
1157 #[doc = "Generic autopilot only supporting simple waypoints"]
1158 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1159 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1160 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1161 #[doc = "Generic autopilot supporting the full mission command set"]
1162 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1163 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1164 MAV_AUTOPILOT_INVALID = 8,
1165 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1166 MAV_AUTOPILOT_PPZ = 9,
1167 #[doc = "UAV Dev Board"]
1168 MAV_AUTOPILOT_UDB = 10,
1169 #[doc = "FlexiPilot"]
1170 MAV_AUTOPILOT_FP = 11,
1171 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1172 MAV_AUTOPILOT_PX4 = 12,
1173 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1174 MAV_AUTOPILOT_SMACCMPILOT = 13,
1175 #[doc = "AutoQuad -- <http://autoquad.org>"]
1176 MAV_AUTOPILOT_AUTOQUAD = 14,
1177 #[doc = "Armazila -- <http://armazila.com>"]
1178 MAV_AUTOPILOT_ARMAZILA = 15,
1179 #[doc = "Aerob -- <http://aerob.ru>"]
1180 MAV_AUTOPILOT_AEROB = 16,
1181 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1182 MAV_AUTOPILOT_ASLUAV = 17,
1183 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1184 MAV_AUTOPILOT_SMARTAP = 18,
1185 #[doc = "AirRails - <http://uaventure.com>"]
1186 MAV_AUTOPILOT_AIRRAILS = 19,
1187 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1188 MAV_AUTOPILOT_REFLEX = 20,
1189}
1190impl MavAutopilot {
1191 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1192}
1193impl Default for MavAutopilot {
1194 fn default() -> Self {
1195 Self::DEFAULT
1196 }
1197}
1198#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1200#[cfg_attr(feature = "serde", serde(tag = "type"))]
1201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1202#[repr(u32)]
1203#[doc = "Enumeration for battery charge states."]
1204pub enum MavBatteryChargeState {
1205 #[doc = "Low battery state is not provided"]
1206 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1207 #[doc = "Battery is not in low state. Normal operation."]
1208 MAV_BATTERY_CHARGE_STATE_OK = 1,
1209 #[doc = "Battery state is low, warn and monitor close."]
1210 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1211 #[doc = "Battery state is critical, return or abort immediately."]
1212 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1213 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1214 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1215 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1216 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1217 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1218 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1219 #[doc = "Battery is charging."]
1220 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1221}
1222impl MavBatteryChargeState {
1223 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1224}
1225impl Default for MavBatteryChargeState {
1226 fn default() -> Self {
1227 Self::DEFAULT
1228 }
1229}
1230bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1231impl MavBatteryFault {
1232 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1233}
1234impl Default for MavBatteryFault {
1235 fn default() -> Self {
1236 Self::DEFAULT
1237 }
1238}
1239#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1240#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1241#[cfg_attr(feature = "serde", serde(tag = "type"))]
1242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1243#[repr(u32)]
1244#[doc = "Enumeration of battery functions"]
1245pub enum MavBatteryFunction {
1246 #[doc = "Battery function is unknown"]
1247 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1248 #[doc = "Battery supports all flight systems"]
1249 MAV_BATTERY_FUNCTION_ALL = 1,
1250 #[doc = "Battery for the propulsion system"]
1251 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1252 #[doc = "Avionics battery"]
1253 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1254 #[doc = "Payload battery"]
1255 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1256}
1257impl MavBatteryFunction {
1258 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1259}
1260impl Default for MavBatteryFunction {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1267#[cfg_attr(feature = "serde", serde(tag = "type"))]
1268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1269#[repr(u32)]
1270#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1271pub enum MavBatteryMode {
1272 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1273 MAV_BATTERY_MODE_UNKNOWN = 0,
1274 #[doc = "Battery is auto discharging (towards storage level)."]
1275 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1276 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1277 MAV_BATTERY_MODE_HOT_SWAP = 2,
1278}
1279impl MavBatteryMode {
1280 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1281}
1282impl Default for MavBatteryMode {
1283 fn default() -> Self {
1284 Self::DEFAULT
1285 }
1286}
1287#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1289#[cfg_attr(feature = "serde", serde(tag = "type"))]
1290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1291#[repr(u32)]
1292#[doc = "Enumeration of battery types"]
1293pub enum MavBatteryType {
1294 #[doc = "Not specified."]
1295 MAV_BATTERY_TYPE_UNKNOWN = 0,
1296 #[doc = "Lithium polymer battery"]
1297 MAV_BATTERY_TYPE_LIPO = 1,
1298 #[doc = "Lithium-iron-phosphate battery"]
1299 MAV_BATTERY_TYPE_LIFE = 2,
1300 #[doc = "Lithium-ION battery"]
1301 MAV_BATTERY_TYPE_LION = 3,
1302 #[doc = "Nickel metal hydride battery"]
1303 MAV_BATTERY_TYPE_NIMH = 4,
1304}
1305impl MavBatteryType {
1306 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1307}
1308impl Default for MavBatteryType {
1309 fn default() -> Self {
1310 Self::DEFAULT
1311 }
1312}
1313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1315#[cfg_attr(feature = "serde", serde(tag = "type"))]
1316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1317#[repr(u32)]
1318#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1319pub enum MavCmd {
1320 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1321 MAV_CMD_NAV_WAYPOINT = 16,
1322 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1323 MAV_CMD_NAV_LOITER_UNLIM = 17,
1324 #[doc = "Loiter around this waypoint for X turns"]
1325 MAV_CMD_NAV_LOITER_TURNS = 18,
1326 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1327 MAV_CMD_NAV_LOITER_TIME = 19,
1328 #[doc = "Return to launch location"]
1329 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1330 #[doc = "Land at location."]
1331 MAV_CMD_NAV_LAND = 21,
1332 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1333 MAV_CMD_NAV_TAKEOFF = 22,
1334 #[doc = "Land at local position (local frame only)"]
1335 MAV_CMD_NAV_LAND_LOCAL = 23,
1336 #[doc = "Takeoff from local position (local frame only)"]
1337 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1338 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1339 MAV_CMD_NAV_FOLLOW = 25,
1340 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1341 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1342 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1343 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1344 #[doc = "Begin following a target"]
1345 MAV_CMD_DO_FOLLOW = 32,
1346 #[doc = "Reposition the MAV after a follow target command has been sent"]
1347 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1348 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1349 MAV_CMD_DO_ORBIT = 34,
1350 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1351 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1352 MAV_CMD_NAV_ROI = 80,
1353 #[doc = "Control autonomous path planning on the MAV."]
1354 MAV_CMD_NAV_PATHPLANNING = 81,
1355 #[doc = "Navigate to waypoint using a spline path."]
1356 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1357 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1358 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1359 #[doc = "Land using VTOL mode"]
1360 MAV_CMD_NAV_VTOL_LAND = 85,
1361 #[doc = "hand control over to an external controller"]
1362 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1363 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1364 MAV_CMD_NAV_DELAY = 93,
1365 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1366 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1367 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1368 MAV_CMD_NAV_LAST = 95,
1369 #[doc = "Delay mission state machine."]
1370 MAV_CMD_CONDITION_DELAY = 112,
1371 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1372 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1373 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1374 MAV_CMD_CONDITION_DISTANCE = 114,
1375 #[doc = "Reach a certain target angle."]
1376 MAV_CMD_CONDITION_YAW = 115,
1377 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1378 MAV_CMD_CONDITION_LAST = 159,
1379 #[doc = "Set system mode."]
1380 MAV_CMD_DO_SET_MODE = 176,
1381 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1382 MAV_CMD_DO_JUMP = 177,
1383 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1384 MAV_CMD_DO_CHANGE_SPEED = 178,
1385 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1386 MAV_CMD_DO_SET_HOME = 179,
1387 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1388 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1389 MAV_CMD_DO_SET_PARAMETER = 180,
1390 #[doc = "Set a relay to a condition."]
1391 MAV_CMD_DO_SET_RELAY = 181,
1392 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1393 MAV_CMD_DO_REPEAT_RELAY = 182,
1394 #[doc = "Set a servo to a desired PWM value."]
1395 MAV_CMD_DO_SET_SERVO = 183,
1396 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1397 MAV_CMD_DO_REPEAT_SERVO = 184,
1398 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1399 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1400 #[doc = "Change altitude set point."]
1401 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1402 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1403 MAV_CMD_DO_SET_ACTUATOR = 187,
1404 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1405 MAV_CMD_DO_RETURN_PATH_START = 188,
1406 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1407 MAV_CMD_DO_LAND_START = 189,
1408 #[doc = "Mission command to perform a landing from a rally point."]
1409 MAV_CMD_DO_RALLY_LAND = 190,
1410 #[doc = "Mission command to safely abort an autonomous landing."]
1411 MAV_CMD_DO_GO_AROUND = 191,
1412 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1413 MAV_CMD_DO_REPOSITION = 192,
1414 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1415 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1416 #[doc = "Set moving direction to forward or reverse."]
1417 MAV_CMD_DO_SET_REVERSE = 194,
1418 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1419 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1420 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1421 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1422 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1423 MAV_CMD_DO_SET_ROI_NONE = 197,
1424 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1425 MAV_CMD_DO_SET_ROI_SYSID = 198,
1426 #[doc = "Control onboard camera system."]
1427 MAV_CMD_DO_CONTROL_VIDEO = 200,
1428 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1429 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1430 MAV_CMD_DO_SET_ROI = 201,
1431 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1432 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1433 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1434 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1435 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1436 #[doc = "Mission command to configure a camera or antenna mount"]
1437 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1438 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1439 #[doc = "Mission command to control a camera or antenna mount"]
1440 MAV_CMD_DO_MOUNT_CONTROL = 205,
1441 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1442 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1443 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1444 MAV_CMD_DO_FENCE_ENABLE = 207,
1445 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1446 MAV_CMD_DO_PARACHUTE = 208,
1447 #[doc = "Command to perform motor test."]
1448 MAV_CMD_DO_MOTOR_TEST = 209,
1449 #[doc = "Change to/from inverted flight."]
1450 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1451 #[doc = "Mission command to operate a gripper."]
1452 MAV_CMD_DO_GRIPPER = 211,
1453 #[doc = "Enable/disable autotune."]
1454 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1455 #[doc = "Sets a desired vehicle turn angle and speed change."]
1456 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1457 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1458 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1459 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1460 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1461 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1462 #[doc = "set id of master controller"]
1463 MAV_CMD_DO_GUIDED_MASTER = 221,
1464 #[doc = "Set limits for external control"]
1465 MAV_CMD_DO_GUIDED_LIMITS = 222,
1466 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1467 MAV_CMD_DO_ENGINE_CONTROL = 223,
1468 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1469 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1470 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1471 MAV_CMD_DO_LAST = 240,
1472 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1473 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1474 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1475 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1476 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1477 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1478 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1479 MAV_CMD_PREFLIGHT_STORAGE = 245,
1480 #[doc = "Request the reboot or shutdown of system components."]
1481 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1482 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1483 MAV_CMD_OVERRIDE_GOTO = 252,
1484 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1485 MAV_CMD_OBLIQUE_SURVEY = 260,
1486 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1487 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1488 #[doc = "start running a mission"]
1489 MAV_CMD_MISSION_START = 300,
1490 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1491 MAV_CMD_ACTUATOR_TEST = 310,
1492 #[doc = "Actuator configuration command."]
1493 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1494 #[doc = "Arms / Disarms a component"]
1495 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1496 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1497 MAV_CMD_RUN_PREARM_CHECKS = 401,
1498 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1499 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1500 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1501 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1502 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1503 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1504 MAV_CMD_GET_HOME_POSITION = 410,
1505 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1506 MAV_CMD_INJECT_FAILURE = 420,
1507 #[doc = "Starts receiver pairing."]
1508 MAV_CMD_START_RX_PAIR = 500,
1509 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1510 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1511 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1512 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1513 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1514 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1515 MAV_CMD_REQUEST_MESSAGE = 512,
1516 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1517 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1518 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1519 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1520 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1521 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1522 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1523 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1524 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1525 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1526 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1527 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1528 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1529 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1530 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1531 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1532 MAV_CMD_STORAGE_FORMAT = 526,
1533 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1534 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1535 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1536 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1537 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1538 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1539 #[doc = "Reset all camera settings to Factory Default"]
1540 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1541 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1542 MAV_CMD_SET_CAMERA_MODE = 530,
1543 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1544 MAV_CMD_SET_CAMERA_ZOOM = 531,
1545 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1546 MAV_CMD_SET_CAMERA_FOCUS = 532,
1547 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1548 MAV_CMD_SET_STORAGE_USAGE = 533,
1549 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1550 MAV_CMD_SET_CAMERA_SOURCE = 534,
1551 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1552 MAV_CMD_JUMP_TAG = 600,
1553 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1554 MAV_CMD_DO_JUMP_TAG = 601,
1555 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1556 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1557 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1558 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1559 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1560 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1561 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1562 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1563 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1564 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1565 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1566 #[doc = "Enable or disable on-board camera triggering system."]
1567 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1568 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1569 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1570 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1571 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1572 #[doc = "Stops ongoing tracking."]
1573 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1574 #[doc = "Starts video capture (recording)."]
1575 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1576 #[doc = "Stop the current video capture (recording)."]
1577 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1578 #[doc = "Start video streaming"]
1579 MAV_CMD_VIDEO_START_STREAMING = 2502,
1580 #[doc = "Stop the given video stream"]
1581 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1582 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1583 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1584 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1585 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1586 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1587 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1588 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1589 MAV_CMD_LOGGING_START = 2510,
1590 #[doc = "Request to stop streaming log data over MAVLink"]
1591 MAV_CMD_LOGGING_STOP = 2511,
1592 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1593 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1594 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1595 #[doc = "Create a panorama at the current position"]
1596 MAV_CMD_PANORAMA_CREATE = 2800,
1597 #[doc = "Request VTOL transition"]
1598 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1599 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1600 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1601 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1602 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1603 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1604 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1605 #[doc = "Delay mission state machine until gate has been reached."]
1606 MAV_CMD_CONDITION_GATE = 4501,
1607 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1608 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1609 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1610 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1611 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1612 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1613 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1614 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1615 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1616 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1617 #[doc = "Rally point. You can have multiple rally points defined."]
1618 MAV_CMD_NAV_RALLY_POINT = 5100,
1619 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1620 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1621 #[doc = "Change state of safety switch."]
1622 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1623 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1624 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1625 #[deprecated = " (Deprecated since 2021-06)"]
1626 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1627 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1628 #[deprecated = " (Deprecated since 2021-06)"]
1629 #[doc = "Control the payload deployment."]
1630 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1631 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1632 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1633 #[doc = "Command to operate winch."]
1634 MAV_CMD_DO_WINCH = 42600,
1635 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1636 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1637 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1638 MAV_CMD_WAYPOINT_USER_1 = 31000,
1639 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1640 MAV_CMD_WAYPOINT_USER_2 = 31001,
1641 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1642 MAV_CMD_WAYPOINT_USER_3 = 31002,
1643 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1644 MAV_CMD_WAYPOINT_USER_4 = 31003,
1645 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1646 MAV_CMD_WAYPOINT_USER_5 = 31004,
1647 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1648 MAV_CMD_SPATIAL_USER_1 = 31005,
1649 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1650 MAV_CMD_SPATIAL_USER_2 = 31006,
1651 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1652 MAV_CMD_SPATIAL_USER_3 = 31007,
1653 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1654 MAV_CMD_SPATIAL_USER_4 = 31008,
1655 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1656 MAV_CMD_SPATIAL_USER_5 = 31009,
1657 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1658 MAV_CMD_USER_1 = 31010,
1659 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1660 MAV_CMD_USER_2 = 31011,
1661 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1662 MAV_CMD_USER_3 = 31012,
1663 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1664 MAV_CMD_USER_4 = 31013,
1665 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1666 MAV_CMD_USER_5 = 31014,
1667 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1668 MAV_CMD_CAN_FORWARD = 32000,
1669}
1670impl MavCmd {
1671 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1672}
1673impl Default for MavCmd {
1674 fn default() -> Self {
1675 Self::DEFAULT
1676 }
1677}
1678#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1680#[cfg_attr(feature = "serde", serde(tag = "type"))]
1681#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1682#[repr(u32)]
1683#[doc = "Possible actions an aircraft can take to avoid a collision."]
1684pub enum MavCollisionAction {
1685 #[doc = "Ignore any potential collisions"]
1686 MAV_COLLISION_ACTION_NONE = 0,
1687 #[doc = "Report potential collision"]
1688 MAV_COLLISION_ACTION_REPORT = 1,
1689 #[doc = "Ascend or Descend to avoid threat"]
1690 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1691 #[doc = "Move horizontally to avoid threat"]
1692 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1693 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1694 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1695 #[doc = "Aircraft to fly directly back to its launch point"]
1696 MAV_COLLISION_ACTION_RTL = 5,
1697 #[doc = "Aircraft to stop in place"]
1698 MAV_COLLISION_ACTION_HOVER = 6,
1699}
1700impl MavCollisionAction {
1701 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1702}
1703impl Default for MavCollisionAction {
1704 fn default() -> Self {
1705 Self::DEFAULT
1706 }
1707}
1708#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1709#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1710#[cfg_attr(feature = "serde", serde(tag = "type"))]
1711#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1712#[repr(u32)]
1713#[doc = "Source of information about this collision."]
1714pub enum MavCollisionSrc {
1715 #[doc = "ID field references ADSB_VEHICLE packets"]
1716 MAV_COLLISION_SRC_ADSB = 0,
1717 #[doc = "ID field references MAVLink SRC ID"]
1718 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1719}
1720impl MavCollisionSrc {
1721 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1722}
1723impl Default for MavCollisionSrc {
1724 fn default() -> Self {
1725 Self::DEFAULT
1726 }
1727}
1728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1730#[cfg_attr(feature = "serde", serde(tag = "type"))]
1731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1732#[repr(u32)]
1733#[doc = "Aircraft-rated danger from this threat."]
1734pub enum MavCollisionThreatLevel {
1735 #[doc = "Not a threat"]
1736 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1737 #[doc = "Craft is mildly concerned about this threat"]
1738 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1739 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1740 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1741}
1742impl MavCollisionThreatLevel {
1743 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1744}
1745impl Default for MavCollisionThreatLevel {
1746 fn default() -> Self {
1747 Self::DEFAULT
1748 }
1749}
1750#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1751#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1752#[cfg_attr(feature = "serde", serde(tag = "type"))]
1753#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1754#[repr(u32)]
1755#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1756pub enum MavComponent {
1757 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1758 MAV_COMP_ID_ALL = 0,
1759 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1760 MAV_COMP_ID_AUTOPILOT1 = 1,
1761 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1762 MAV_COMP_ID_USER1 = 25,
1763 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1764 MAV_COMP_ID_USER2 = 26,
1765 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1766 MAV_COMP_ID_USER3 = 27,
1767 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1768 MAV_COMP_ID_USER4 = 28,
1769 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1770 MAV_COMP_ID_USER5 = 29,
1771 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1772 MAV_COMP_ID_USER6 = 30,
1773 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1774 MAV_COMP_ID_USER7 = 31,
1775 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1776 MAV_COMP_ID_USER8 = 32,
1777 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1778 MAV_COMP_ID_USER9 = 33,
1779 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1780 MAV_COMP_ID_USER10 = 34,
1781 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1782 MAV_COMP_ID_USER11 = 35,
1783 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1784 MAV_COMP_ID_USER12 = 36,
1785 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1786 MAV_COMP_ID_USER13 = 37,
1787 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1788 MAV_COMP_ID_USER14 = 38,
1789 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1790 MAV_COMP_ID_USER15 = 39,
1791 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1792 MAV_COMP_ID_USER16 = 40,
1793 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1794 MAV_COMP_ID_USER17 = 41,
1795 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1796 MAV_COMP_ID_USER18 = 42,
1797 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1798 MAV_COMP_ID_USER19 = 43,
1799 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1800 MAV_COMP_ID_USER20 = 44,
1801 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1802 MAV_COMP_ID_USER21 = 45,
1803 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1804 MAV_COMP_ID_USER22 = 46,
1805 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1806 MAV_COMP_ID_USER23 = 47,
1807 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1808 MAV_COMP_ID_USER24 = 48,
1809 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1810 MAV_COMP_ID_USER25 = 49,
1811 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1812 MAV_COMP_ID_USER26 = 50,
1813 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1814 MAV_COMP_ID_USER27 = 51,
1815 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1816 MAV_COMP_ID_USER28 = 52,
1817 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1818 MAV_COMP_ID_USER29 = 53,
1819 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1820 MAV_COMP_ID_USER30 = 54,
1821 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1822 MAV_COMP_ID_USER31 = 55,
1823 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1824 MAV_COMP_ID_USER32 = 56,
1825 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1826 MAV_COMP_ID_USER33 = 57,
1827 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1828 MAV_COMP_ID_USER34 = 58,
1829 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1830 MAV_COMP_ID_USER35 = 59,
1831 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1832 MAV_COMP_ID_USER36 = 60,
1833 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1834 MAV_COMP_ID_USER37 = 61,
1835 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1836 MAV_COMP_ID_USER38 = 62,
1837 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1838 MAV_COMP_ID_USER39 = 63,
1839 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1840 MAV_COMP_ID_USER40 = 64,
1841 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1842 MAV_COMP_ID_USER41 = 65,
1843 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1844 MAV_COMP_ID_USER42 = 66,
1845 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1846 MAV_COMP_ID_USER43 = 67,
1847 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1848 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1849 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1850 MAV_COMP_ID_USER45 = 69,
1851 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1852 MAV_COMP_ID_USER46 = 70,
1853 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1854 MAV_COMP_ID_USER47 = 71,
1855 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1856 MAV_COMP_ID_USER48 = 72,
1857 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1858 MAV_COMP_ID_USER49 = 73,
1859 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1860 MAV_COMP_ID_USER50 = 74,
1861 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1862 MAV_COMP_ID_USER51 = 75,
1863 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1864 MAV_COMP_ID_USER52 = 76,
1865 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1866 MAV_COMP_ID_USER53 = 77,
1867 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1868 MAV_COMP_ID_USER54 = 78,
1869 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1870 MAV_COMP_ID_USER55 = 79,
1871 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1872 MAV_COMP_ID_USER56 = 80,
1873 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1874 MAV_COMP_ID_USER57 = 81,
1875 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1876 MAV_COMP_ID_USER58 = 82,
1877 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1878 MAV_COMP_ID_USER59 = 83,
1879 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1880 MAV_COMP_ID_USER60 = 84,
1881 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1882 MAV_COMP_ID_USER61 = 85,
1883 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1884 MAV_COMP_ID_USER62 = 86,
1885 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1886 MAV_COMP_ID_USER63 = 87,
1887 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1888 MAV_COMP_ID_USER64 = 88,
1889 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1890 MAV_COMP_ID_USER65 = 89,
1891 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1892 MAV_COMP_ID_USER66 = 90,
1893 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1894 MAV_COMP_ID_USER67 = 91,
1895 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1896 MAV_COMP_ID_USER68 = 92,
1897 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1898 MAV_COMP_ID_USER69 = 93,
1899 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1900 MAV_COMP_ID_USER70 = 94,
1901 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1902 MAV_COMP_ID_USER71 = 95,
1903 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1904 MAV_COMP_ID_USER72 = 96,
1905 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1906 MAV_COMP_ID_USER73 = 97,
1907 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1908 MAV_COMP_ID_USER74 = 98,
1909 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1910 MAV_COMP_ID_USER75 = 99,
1911 #[doc = "Camera #1."]
1912 MAV_COMP_ID_CAMERA = 100,
1913 #[doc = "Camera #2."]
1914 MAV_COMP_ID_CAMERA2 = 101,
1915 #[doc = "Camera #3."]
1916 MAV_COMP_ID_CAMERA3 = 102,
1917 #[doc = "Camera #4."]
1918 MAV_COMP_ID_CAMERA4 = 103,
1919 #[doc = "Camera #5."]
1920 MAV_COMP_ID_CAMERA5 = 104,
1921 #[doc = "Camera #6."]
1922 MAV_COMP_ID_CAMERA6 = 105,
1923 #[doc = "Servo #1."]
1924 MAV_COMP_ID_SERVO1 = 140,
1925 #[doc = "Servo #2."]
1926 MAV_COMP_ID_SERVO2 = 141,
1927 #[doc = "Servo #3."]
1928 MAV_COMP_ID_SERVO3 = 142,
1929 #[doc = "Servo #4."]
1930 MAV_COMP_ID_SERVO4 = 143,
1931 #[doc = "Servo #5."]
1932 MAV_COMP_ID_SERVO5 = 144,
1933 #[doc = "Servo #6."]
1934 MAV_COMP_ID_SERVO6 = 145,
1935 #[doc = "Servo #7."]
1936 MAV_COMP_ID_SERVO7 = 146,
1937 #[doc = "Servo #8."]
1938 MAV_COMP_ID_SERVO8 = 147,
1939 #[doc = "Servo #9."]
1940 MAV_COMP_ID_SERVO9 = 148,
1941 #[doc = "Servo #10."]
1942 MAV_COMP_ID_SERVO10 = 149,
1943 #[doc = "Servo #11."]
1944 MAV_COMP_ID_SERVO11 = 150,
1945 #[doc = "Servo #12."]
1946 MAV_COMP_ID_SERVO12 = 151,
1947 #[doc = "Servo #13."]
1948 MAV_COMP_ID_SERVO13 = 152,
1949 #[doc = "Servo #14."]
1950 MAV_COMP_ID_SERVO14 = 153,
1951 #[doc = "Gimbal #1."]
1952 MAV_COMP_ID_GIMBAL = 154,
1953 #[doc = "Logging component."]
1954 MAV_COMP_ID_LOG = 155,
1955 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
1956 MAV_COMP_ID_ADSB = 156,
1957 #[doc = "On Screen Display (OSD) devices for video links."]
1958 MAV_COMP_ID_OSD = 157,
1959 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
1960 MAV_COMP_ID_PERIPHERAL = 158,
1961 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
1962 #[doc = "Gimbal ID for QX1."]
1963 MAV_COMP_ID_QX1_GIMBAL = 159,
1964 #[doc = "FLARM collision alert component."]
1965 MAV_COMP_ID_FLARM = 160,
1966 #[doc = "Parachute component."]
1967 MAV_COMP_ID_PARACHUTE = 161,
1968 #[doc = "Winch component."]
1969 MAV_COMP_ID_WINCH = 169,
1970 #[doc = "Gimbal #2."]
1971 MAV_COMP_ID_GIMBAL2 = 171,
1972 #[doc = "Gimbal #3."]
1973 MAV_COMP_ID_GIMBAL3 = 172,
1974 #[doc = "Gimbal #4"]
1975 MAV_COMP_ID_GIMBAL4 = 173,
1976 #[doc = "Gimbal #5."]
1977 MAV_COMP_ID_GIMBAL5 = 174,
1978 #[doc = "Gimbal #6."]
1979 MAV_COMP_ID_GIMBAL6 = 175,
1980 #[doc = "Battery #1."]
1981 MAV_COMP_ID_BATTERY = 180,
1982 #[doc = "Battery #2."]
1983 MAV_COMP_ID_BATTERY2 = 181,
1984 #[doc = "CAN over MAVLink client."]
1985 MAV_COMP_ID_MAVCAN = 189,
1986 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
1987 MAV_COMP_ID_MISSIONPLANNER = 190,
1988 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1989 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
1990 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1991 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
1992 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1993 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
1994 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
1995 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
1996 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
1997 MAV_COMP_ID_PATHPLANNER = 195,
1998 #[doc = "Component that plans a collision free path between two points."]
1999 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2000 #[doc = "Component that provides position estimates using VIO techniques."]
2001 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2002 #[doc = "Component that manages pairing of vehicle and GCS."]
2003 MAV_COMP_ID_PAIRING_MANAGER = 198,
2004 #[doc = "Inertial Measurement Unit (IMU) #1."]
2005 MAV_COMP_ID_IMU = 200,
2006 #[doc = "Inertial Measurement Unit (IMU) #2."]
2007 MAV_COMP_ID_IMU_2 = 201,
2008 #[doc = "Inertial Measurement Unit (IMU) #3."]
2009 MAV_COMP_ID_IMU_3 = 202,
2010 #[doc = "GPS #1."]
2011 MAV_COMP_ID_GPS = 220,
2012 #[doc = "GPS #2."]
2013 MAV_COMP_ID_GPS2 = 221,
2014 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2015 MAV_COMP_ID_ODID_TXRX_1 = 236,
2016 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2017 MAV_COMP_ID_ODID_TXRX_2 = 237,
2018 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2019 MAV_COMP_ID_ODID_TXRX_3 = 238,
2020 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2021 MAV_COMP_ID_UDP_BRIDGE = 240,
2022 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2023 MAV_COMP_ID_UART_BRIDGE = 241,
2024 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2025 MAV_COMP_ID_TUNNEL_NODE = 242,
2026 #[doc = "Illuminator"]
2027 MAV_COMP_ID_ILLUMINATOR = 243,
2028 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2029 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2030 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2031}
2032impl MavComponent {
2033 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2034}
2035impl Default for MavComponent {
2036 fn default() -> Self {
2037 Self::DEFAULT
2038 }
2039}
2040#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2042#[cfg_attr(feature = "serde", serde(tag = "type"))]
2043#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2044#[repr(u32)]
2045#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2046#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2047pub enum MavDataStream {
2048 #[doc = "Enable all data streams"]
2049 MAV_DATA_STREAM_ALL = 0,
2050 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2051 MAV_DATA_STREAM_RAW_SENSORS = 1,
2052 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2053 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2054 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2055 MAV_DATA_STREAM_RC_CHANNELS = 3,
2056 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2057 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2058 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2059 MAV_DATA_STREAM_POSITION = 6,
2060 #[doc = "Dependent on the autopilot"]
2061 MAV_DATA_STREAM_EXTRA1 = 10,
2062 #[doc = "Dependent on the autopilot"]
2063 MAV_DATA_STREAM_EXTRA2 = 11,
2064 #[doc = "Dependent on the autopilot"]
2065 MAV_DATA_STREAM_EXTRA3 = 12,
2066}
2067impl MavDataStream {
2068 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2069}
2070impl Default for MavDataStream {
2071 fn default() -> Self {
2072 Self::DEFAULT
2073 }
2074}
2075#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2077#[cfg_attr(feature = "serde", serde(tag = "type"))]
2078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2079#[repr(u32)]
2080#[doc = "Enumeration of distance sensor types"]
2081pub enum MavDistanceSensor {
2082 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2083 MAV_DISTANCE_SENSOR_LASER = 0,
2084 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2085 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2086 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2087 MAV_DISTANCE_SENSOR_INFRARED = 2,
2088 #[doc = "Radar type, e.g. uLanding units"]
2089 MAV_DISTANCE_SENSOR_RADAR = 3,
2090 #[doc = "Broken or unknown type, e.g. analog units"]
2091 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2092}
2093impl MavDistanceSensor {
2094 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2095}
2096impl Default for MavDistanceSensor {
2097 fn default() -> Self {
2098 Self::DEFAULT
2099 }
2100}
2101#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2102#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2103#[cfg_attr(feature = "serde", serde(tag = "type"))]
2104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2105#[repr(u32)]
2106#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2107pub enum MavDoRepositionFlags {
2108 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2109 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2110}
2111impl MavDoRepositionFlags {
2112 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2113}
2114impl Default for MavDoRepositionFlags {
2115 fn default() -> Self {
2116 Self::DEFAULT
2117 }
2118}
2119#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2121#[cfg_attr(feature = "serde", serde(tag = "type"))]
2122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2123#[repr(u32)]
2124#[doc = "Enumeration of estimator types"]
2125pub enum MavEstimatorType {
2126 #[doc = "Unknown type of the estimator."]
2127 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2128 #[doc = "This is a naive estimator without any real covariance feedback."]
2129 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2130 #[doc = "Computer vision based estimate. Might be up to scale."]
2131 MAV_ESTIMATOR_TYPE_VISION = 2,
2132 #[doc = "Visual-inertial estimate."]
2133 MAV_ESTIMATOR_TYPE_VIO = 3,
2134 #[doc = "Plain GPS estimate."]
2135 MAV_ESTIMATOR_TYPE_GPS = 4,
2136 #[doc = "Estimator integrating GPS and inertial sensing."]
2137 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2138 #[doc = "Estimate from external motion capturing system."]
2139 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2140 #[doc = "Estimator based on lidar sensor input."]
2141 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2142 #[doc = "Estimator on autopilot."]
2143 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2144}
2145impl MavEstimatorType {
2146 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2147}
2148impl Default for MavEstimatorType {
2149 fn default() -> Self {
2150 Self::DEFAULT
2151 }
2152}
2153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2155#[cfg_attr(feature = "serde", serde(tag = "type"))]
2156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2157#[repr(u32)]
2158#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2159pub enum MavEventCurrentSequenceFlags {
2160 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2161 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2162}
2163impl MavEventCurrentSequenceFlags {
2164 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2165}
2166impl Default for MavEventCurrentSequenceFlags {
2167 fn default() -> Self {
2168 Self::DEFAULT
2169 }
2170}
2171#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2173#[cfg_attr(feature = "serde", serde(tag = "type"))]
2174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2175#[repr(u32)]
2176#[doc = "Reason for an event error response."]
2177pub enum MavEventErrorReason {
2178 #[doc = "The requested event is not available (anymore)."]
2179 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2180}
2181impl MavEventErrorReason {
2182 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2183}
2184impl Default for MavEventErrorReason {
2185 fn default() -> Self {
2186 Self::DEFAULT
2187 }
2188}
2189#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2191#[cfg_attr(feature = "serde", serde(tag = "type"))]
2192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2193#[repr(u32)]
2194#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2195pub enum MavFrame {
2196 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2197 MAV_FRAME_GLOBAL = 0,
2198 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2199 MAV_FRAME_LOCAL_NED = 1,
2200 #[doc = "NOT a coordinate frame, indicates a mission command."]
2201 MAV_FRAME_MISSION = 2,
2202 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2203 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2204 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2205 MAV_FRAME_LOCAL_ENU = 4,
2206 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2207 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2208 MAV_FRAME_GLOBAL_INT = 5,
2209 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2210 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2211 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2212 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2213 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2214 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2215 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2216 MAV_FRAME_BODY_NED = 8,
2217 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2218 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2219 MAV_FRAME_BODY_OFFSET_NED = 9,
2220 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2221 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2222 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2223 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2224 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2225 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2226 MAV_FRAME_BODY_FRD = 12,
2227 #[deprecated = " (Deprecated since 2019-04)"]
2228 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2229 MAV_FRAME_RESERVED_13 = 13,
2230 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2231 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2232 MAV_FRAME_RESERVED_14 = 14,
2233 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2234 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2235 MAV_FRAME_RESERVED_15 = 15,
2236 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2237 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2238 MAV_FRAME_RESERVED_16 = 16,
2239 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2240 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2241 MAV_FRAME_RESERVED_17 = 17,
2242 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2243 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2244 MAV_FRAME_RESERVED_18 = 18,
2245 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2246 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2247 MAV_FRAME_RESERVED_19 = 19,
2248 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2249 MAV_FRAME_LOCAL_FRD = 20,
2250 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2251 MAV_FRAME_LOCAL_FLU = 21,
2252}
2253impl MavFrame {
2254 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2255}
2256impl Default for MavFrame {
2257 fn default() -> Self {
2258 Self::DEFAULT
2259 }
2260}
2261#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2262#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2263#[cfg_attr(feature = "serde", serde(tag = "type"))]
2264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2265#[repr(u32)]
2266#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2267pub enum MavFtpErr {
2268 #[doc = "None: No error"]
2269 MAV_FTP_ERR_NONE = 0,
2270 #[doc = "Fail: Unknown failure"]
2271 MAV_FTP_ERR_FAIL = 1,
2272 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2273 MAV_FTP_ERR_FAILERRNO = 2,
2274 #[doc = "InvalidDataSize: Payload size is invalid"]
2275 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2276 #[doc = "InvalidSession: Session is not currently open"]
2277 MAV_FTP_ERR_INVALIDSESSION = 4,
2278 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2279 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2280 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2281 MAV_FTP_ERR_EOF = 6,
2282 #[doc = "UnknownCommand: Unknown command / opcode"]
2283 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2284 #[doc = "FileExists: File/directory already exists"]
2285 MAV_FTP_ERR_FILEEXISTS = 8,
2286 #[doc = "FileProtected: File/directory is write protected"]
2287 MAV_FTP_ERR_FILEPROTECTED = 9,
2288 #[doc = "FileNotFound: File/directory not found"]
2289 MAV_FTP_ERR_FILENOTFOUND = 10,
2290}
2291impl MavFtpErr {
2292 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2293}
2294impl Default for MavFtpErr {
2295 fn default() -> Self {
2296 Self::DEFAULT
2297 }
2298}
2299#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2301#[cfg_attr(feature = "serde", serde(tag = "type"))]
2302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2303#[repr(u32)]
2304#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2305pub enum MavFtpOpcode {
2306 #[doc = "None. Ignored, always ACKed"]
2307 MAV_FTP_OPCODE_NONE = 0,
2308 #[doc = "TerminateSession: Terminates open Read session"]
2309 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2310 #[doc = "ResetSessions: Terminates all open read sessions"]
2311 MAV_FTP_OPCODE_RESETSESSION = 2,
2312 #[doc = "ListDirectory. List files and directories in path from offset"]
2313 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2314 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2315 MAV_FTP_OPCODE_OPENFILERO = 4,
2316 #[doc = "ReadFile: Reads size bytes from offset in session"]
2317 MAV_FTP_OPCODE_READFILE = 5,
2318 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2319 MAV_FTP_OPCODE_CREATEFILE = 6,
2320 #[doc = "WriteFile: Writes size bytes to offset in session"]
2321 MAV_FTP_OPCODE_WRITEFILE = 7,
2322 #[doc = "RemoveFile: Remove file at path"]
2323 MAV_FTP_OPCODE_REMOVEFILE = 8,
2324 #[doc = "CreateDirectory: Creates directory at path"]
2325 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2326 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2327 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2328 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2329 MAV_FTP_OPCODE_OPENFILEWO = 11,
2330 #[doc = "TruncateFile: Truncate file at path to offset length"]
2331 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2332 #[doc = "Rename: Rename path1 to path2"]
2333 MAV_FTP_OPCODE_RENAME = 13,
2334 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2335 MAV_FTP_OPCODE_CALCFILECRC = 14,
2336 #[doc = "BurstReadFile: Burst download session file"]
2337 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2338 #[doc = "ACK: ACK response"]
2339 MAV_FTP_OPCODE_ACK = 128,
2340 #[doc = "NAK: NAK response"]
2341 MAV_FTP_OPCODE_NAK = 129,
2342}
2343impl MavFtpOpcode {
2344 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2345}
2346impl Default for MavFtpOpcode {
2347 fn default() -> Self {
2348 Self::DEFAULT
2349 }
2350}
2351#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2353#[cfg_attr(feature = "serde", serde(tag = "type"))]
2354#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2355#[repr(u32)]
2356#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2357pub enum MavFuelType {
2358 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2359 MAV_FUEL_TYPE_UNKNOWN = 0,
2360 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2361 MAV_FUEL_TYPE_LIQUID = 1,
2362 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2363 MAV_FUEL_TYPE_GAS = 2,
2364}
2365impl MavFuelType {
2366 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2367}
2368impl Default for MavFuelType {
2369 fn default() -> Self {
2370 Self::DEFAULT
2371 }
2372}
2373bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2374impl MavGeneratorStatusFlag {
2375 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2376}
2377impl Default for MavGeneratorStatusFlag {
2378 fn default() -> Self {
2379 Self::DEFAULT
2380 }
2381}
2382#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2383#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2384#[cfg_attr(feature = "serde", serde(tag = "type"))]
2385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2386#[repr(u32)]
2387#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2388pub enum MavGoto {
2389 #[doc = "Hold at the current position."]
2390 MAV_GOTO_DO_HOLD = 0,
2391 #[doc = "Continue with the next item in mission execution."]
2392 MAV_GOTO_DO_CONTINUE = 1,
2393 #[doc = "Hold at the current position of the system"]
2394 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2395 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2396 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2397}
2398impl MavGoto {
2399 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2400}
2401impl Default for MavGoto {
2402 fn default() -> Self {
2403 Self::DEFAULT
2404 }
2405}
2406#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2408#[cfg_attr(feature = "serde", serde(tag = "type"))]
2409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2410#[repr(u32)]
2411#[doc = "Enumeration of landed detector states"]
2412pub enum MavLandedState {
2413 #[doc = "MAV landed state is unknown"]
2414 MAV_LANDED_STATE_UNDEFINED = 0,
2415 #[doc = "MAV is landed (on ground)"]
2416 MAV_LANDED_STATE_ON_GROUND = 1,
2417 #[doc = "MAV is in air"]
2418 MAV_LANDED_STATE_IN_AIR = 2,
2419 #[doc = "MAV currently taking off"]
2420 MAV_LANDED_STATE_TAKEOFF = 3,
2421 #[doc = "MAV currently landing"]
2422 MAV_LANDED_STATE_LANDING = 4,
2423}
2424impl MavLandedState {
2425 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2426}
2427impl Default for MavLandedState {
2428 fn default() -> Self {
2429 Self::DEFAULT
2430 }
2431}
2432#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2433#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2434#[cfg_attr(feature = "serde", serde(tag = "type"))]
2435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2436#[repr(u32)]
2437#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2438pub enum MavMissionResult {
2439 #[doc = "mission accepted OK"]
2440 MAV_MISSION_ACCEPTED = 0,
2441 #[doc = "Generic error / not accepting mission commands at all right now."]
2442 MAV_MISSION_ERROR = 1,
2443 #[doc = "Coordinate frame is not supported."]
2444 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2445 #[doc = "Command is not supported."]
2446 MAV_MISSION_UNSUPPORTED = 3,
2447 #[doc = "Mission items exceed storage space."]
2448 MAV_MISSION_NO_SPACE = 4,
2449 #[doc = "One of the parameters has an invalid value."]
2450 MAV_MISSION_INVALID = 5,
2451 #[doc = "param1 has an invalid value."]
2452 MAV_MISSION_INVALID_PARAM1 = 6,
2453 #[doc = "param2 has an invalid value."]
2454 MAV_MISSION_INVALID_PARAM2 = 7,
2455 #[doc = "param3 has an invalid value."]
2456 MAV_MISSION_INVALID_PARAM3 = 8,
2457 #[doc = "param4 has an invalid value."]
2458 MAV_MISSION_INVALID_PARAM4 = 9,
2459 #[doc = "x / param5 has an invalid value."]
2460 MAV_MISSION_INVALID_PARAM5_X = 10,
2461 #[doc = "y / param6 has an invalid value."]
2462 MAV_MISSION_INVALID_PARAM6_Y = 11,
2463 #[doc = "z / param7 has an invalid value."]
2464 MAV_MISSION_INVALID_PARAM7 = 12,
2465 #[doc = "Mission item received out of sequence"]
2466 MAV_MISSION_INVALID_SEQUENCE = 13,
2467 #[doc = "Not accepting any mission commands from this communication partner."]
2468 MAV_MISSION_DENIED = 14,
2469 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2470 MAV_MISSION_OPERATION_CANCELLED = 15,
2471}
2472impl MavMissionResult {
2473 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2474}
2475impl Default for MavMissionResult {
2476 fn default() -> Self {
2477 Self::DEFAULT
2478 }
2479}
2480#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2482#[cfg_attr(feature = "serde", serde(tag = "type"))]
2483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2484#[repr(u32)]
2485#[doc = "Type of mission items being requested/sent in mission protocol."]
2486pub enum MavMissionType {
2487 #[doc = "Items are mission commands for main mission."]
2488 MAV_MISSION_TYPE_MISSION = 0,
2489 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2490 MAV_MISSION_TYPE_FENCE = 1,
2491 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2492 MAV_MISSION_TYPE_RALLY = 2,
2493 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2494 MAV_MISSION_TYPE_ALL = 255,
2495}
2496impl MavMissionType {
2497 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2498}
2499impl Default for MavMissionType {
2500 fn default() -> Self {
2501 Self::DEFAULT
2502 }
2503}
2504#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2506#[cfg_attr(feature = "serde", serde(tag = "type"))]
2507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2508#[repr(u32)]
2509#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2510pub enum MavMode {
2511 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2512 MAV_MODE_PREFLIGHT = 0,
2513 #[doc = "System is allowed to be active, under assisted RC control."]
2514 MAV_MODE_STABILIZE_DISARMED = 80,
2515 #[doc = "System is allowed to be active, under assisted RC control."]
2516 MAV_MODE_STABILIZE_ARMED = 208,
2517 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2518 MAV_MODE_MANUAL_DISARMED = 64,
2519 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2520 MAV_MODE_MANUAL_ARMED = 192,
2521 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2522 MAV_MODE_GUIDED_DISARMED = 88,
2523 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2524 MAV_MODE_GUIDED_ARMED = 216,
2525 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2526 MAV_MODE_AUTO_DISARMED = 92,
2527 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2528 MAV_MODE_AUTO_ARMED = 220,
2529 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2530 MAV_MODE_TEST_DISARMED = 66,
2531 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2532 MAV_MODE_TEST_ARMED = 194,
2533}
2534impl MavMode {
2535 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2536}
2537impl Default for MavMode {
2538 fn default() -> Self {
2539 Self::DEFAULT
2540 }
2541}
2542bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2543impl MavModeFlag {
2544 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2545}
2546impl Default for MavModeFlag {
2547 fn default() -> Self {
2548 Self::DEFAULT
2549 }
2550}
2551#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2552#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2553#[cfg_attr(feature = "serde", serde(tag = "type"))]
2554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2555#[repr(u32)]
2556#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2557pub enum MavModeFlagDecodePosition {
2558 #[doc = "First bit: 10000000"]
2559 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2560 #[doc = "Second bit: 01000000"]
2561 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2562 #[doc = "Third bit: 00100000"]
2563 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2564 #[doc = "Fourth bit: 00010000"]
2565 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2566 #[doc = "Fifth bit: 00001000"]
2567 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2568 #[doc = "Sixth bit: 00000100"]
2569 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2570 #[doc = "Seventh bit: 00000010"]
2571 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2572 #[doc = "Eighth bit: 00000001"]
2573 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2574}
2575impl MavModeFlagDecodePosition {
2576 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2577}
2578impl Default for MavModeFlagDecodePosition {
2579 fn default() -> Self {
2580 Self::DEFAULT
2581 }
2582}
2583bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2584impl MavModeProperty {
2585 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2586}
2587impl Default for MavModeProperty {
2588 fn default() -> Self {
2589 Self::DEFAULT
2590 }
2591}
2592#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2594#[cfg_attr(feature = "serde", serde(tag = "type"))]
2595#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2596#[repr(u32)]
2597#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2598#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2599pub enum MavMountMode {
2600 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2601 MAV_MOUNT_MODE_RETRACT = 0,
2602 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2603 MAV_MOUNT_MODE_NEUTRAL = 1,
2604 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2605 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2606 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2607 MAV_MOUNT_MODE_RC_TARGETING = 3,
2608 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2609 MAV_MOUNT_MODE_GPS_POINT = 4,
2610 #[doc = "Gimbal tracks system with specified system ID"]
2611 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2612 #[doc = "Gimbal tracks home position"]
2613 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2614}
2615impl MavMountMode {
2616 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2617}
2618impl Default for MavMountMode {
2619 fn default() -> Self {
2620 Self::DEFAULT
2621 }
2622}
2623#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2625#[cfg_attr(feature = "serde", serde(tag = "type"))]
2626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2627#[repr(u32)]
2628pub enum MavOdidArmStatus {
2629 #[doc = "Passing arming checks."]
2630 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2631 #[doc = "Generic arming failure, see error string for details."]
2632 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2633}
2634impl MavOdidArmStatus {
2635 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2636}
2637impl Default for MavOdidArmStatus {
2638 fn default() -> Self {
2639 Self::DEFAULT
2640 }
2641}
2642#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2644#[cfg_attr(feature = "serde", serde(tag = "type"))]
2645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2646#[repr(u32)]
2647pub enum MavOdidAuthType {
2648 #[doc = "No authentication type is specified."]
2649 MAV_ODID_AUTH_TYPE_NONE = 0,
2650 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2651 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2652 #[doc = "Signature for the Operator ID."]
2653 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2654 #[doc = "Signature for the entire message set."]
2655 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2656 #[doc = "Authentication is provided by Network Remote ID."]
2657 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2658 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2659 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2660}
2661impl MavOdidAuthType {
2662 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2663}
2664impl Default for MavOdidAuthType {
2665 fn default() -> Self {
2666 Self::DEFAULT
2667 }
2668}
2669#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2671#[cfg_attr(feature = "serde", serde(tag = "type"))]
2672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2673#[repr(u32)]
2674pub enum MavOdidCategoryEu {
2675 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2676 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2677 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2678 MAV_ODID_CATEGORY_EU_OPEN = 1,
2679 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2680 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2681 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2682 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2683}
2684impl MavOdidCategoryEu {
2685 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2686}
2687impl Default for MavOdidCategoryEu {
2688 fn default() -> Self {
2689 Self::DEFAULT
2690 }
2691}
2692#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2693#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2694#[cfg_attr(feature = "serde", serde(tag = "type"))]
2695#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2696#[repr(u32)]
2697pub enum MavOdidClassEu {
2698 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2699 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2700 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2701 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2702 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2703 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2704 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2705 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2706 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2707 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2708 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2709 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2710 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2711 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2712 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2713 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2714}
2715impl MavOdidClassEu {
2716 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2717}
2718impl Default for MavOdidClassEu {
2719 fn default() -> Self {
2720 Self::DEFAULT
2721 }
2722}
2723#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2724#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2725#[cfg_attr(feature = "serde", serde(tag = "type"))]
2726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2727#[repr(u32)]
2728pub enum MavOdidClassificationType {
2729 #[doc = "The classification type for the UA is undeclared."]
2730 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2731 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2732 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2733}
2734impl MavOdidClassificationType {
2735 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2736}
2737impl Default for MavOdidClassificationType {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2743#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2744#[cfg_attr(feature = "serde", serde(tag = "type"))]
2745#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2746#[repr(u32)]
2747pub enum MavOdidDescType {
2748 #[doc = "Optional free-form text description of the purpose of the flight."]
2749 MAV_ODID_DESC_TYPE_TEXT = 0,
2750 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2751 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2752 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2753 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2754}
2755impl MavOdidDescType {
2756 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2757}
2758impl Default for MavOdidDescType {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2765#[cfg_attr(feature = "serde", serde(tag = "type"))]
2766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2767#[repr(u32)]
2768pub enum MavOdidHeightRef {
2769 #[doc = "The height field is relative to the take-off location."]
2770 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2771 #[doc = "The height field is relative to ground."]
2772 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2773}
2774impl MavOdidHeightRef {
2775 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2776}
2777impl Default for MavOdidHeightRef {
2778 fn default() -> Self {
2779 Self::DEFAULT
2780 }
2781}
2782#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2784#[cfg_attr(feature = "serde", serde(tag = "type"))]
2785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2786#[repr(u32)]
2787pub enum MavOdidHorAcc {
2788 #[doc = "The horizontal accuracy is unknown."]
2789 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2790 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2791 MAV_ODID_HOR_ACC_10NM = 1,
2792 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2793 MAV_ODID_HOR_ACC_4NM = 2,
2794 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2795 MAV_ODID_HOR_ACC_2NM = 3,
2796 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2797 MAV_ODID_HOR_ACC_1NM = 4,
2798 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2799 MAV_ODID_HOR_ACC_0_5NM = 5,
2800 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2801 MAV_ODID_HOR_ACC_0_3NM = 6,
2802 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2803 MAV_ODID_HOR_ACC_0_1NM = 7,
2804 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2805 MAV_ODID_HOR_ACC_0_05NM = 8,
2806 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2807 MAV_ODID_HOR_ACC_30_METER = 9,
2808 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2809 MAV_ODID_HOR_ACC_10_METER = 10,
2810 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2811 MAV_ODID_HOR_ACC_3_METER = 11,
2812 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2813 MAV_ODID_HOR_ACC_1_METER = 12,
2814}
2815impl MavOdidHorAcc {
2816 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2817}
2818impl Default for MavOdidHorAcc {
2819 fn default() -> Self {
2820 Self::DEFAULT
2821 }
2822}
2823#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2824#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2825#[cfg_attr(feature = "serde", serde(tag = "type"))]
2826#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2827#[repr(u32)]
2828pub enum MavOdidIdType {
2829 #[doc = "No type defined."]
2830 MAV_ODID_ID_TYPE_NONE = 0,
2831 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2832 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2833 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2834 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2835 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2836 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2837 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2838 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2839}
2840impl MavOdidIdType {
2841 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2842}
2843impl Default for MavOdidIdType {
2844 fn default() -> Self {
2845 Self::DEFAULT
2846 }
2847}
2848#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2849#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2850#[cfg_attr(feature = "serde", serde(tag = "type"))]
2851#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2852#[repr(u32)]
2853pub enum MavOdidOperatorIdType {
2854 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2855 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2856}
2857impl MavOdidOperatorIdType {
2858 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2859}
2860impl Default for MavOdidOperatorIdType {
2861 fn default() -> Self {
2862 Self::DEFAULT
2863 }
2864}
2865#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2867#[cfg_attr(feature = "serde", serde(tag = "type"))]
2868#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2869#[repr(u32)]
2870pub enum MavOdidOperatorLocationType {
2871 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2872 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2873 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2874 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2875 #[doc = "The location/altitude of the operator are fixed values."]
2876 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2877}
2878impl MavOdidOperatorLocationType {
2879 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2880}
2881impl Default for MavOdidOperatorLocationType {
2882 fn default() -> Self {
2883 Self::DEFAULT
2884 }
2885}
2886#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2888#[cfg_attr(feature = "serde", serde(tag = "type"))]
2889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2890#[repr(u32)]
2891pub enum MavOdidSpeedAcc {
2892 #[doc = "The speed accuracy is unknown."]
2893 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2894 #[doc = "The speed accuracy is smaller than 10 meters per second."]
2895 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
2896 #[doc = "The speed accuracy is smaller than 3 meters per second."]
2897 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
2898 #[doc = "The speed accuracy is smaller than 1 meters per second."]
2899 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
2900 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
2901 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
2902}
2903impl MavOdidSpeedAcc {
2904 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
2905}
2906impl Default for MavOdidSpeedAcc {
2907 fn default() -> Self {
2908 Self::DEFAULT
2909 }
2910}
2911#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2913#[cfg_attr(feature = "serde", serde(tag = "type"))]
2914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2915#[repr(u32)]
2916pub enum MavOdidStatus {
2917 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2918 MAV_ODID_STATUS_UNDECLARED = 0,
2919 #[doc = "The UA is on the ground."]
2920 MAV_ODID_STATUS_GROUND = 1,
2921 #[doc = "The UA is in the air."]
2922 MAV_ODID_STATUS_AIRBORNE = 2,
2923 #[doc = "The UA is having an emergency."]
2924 MAV_ODID_STATUS_EMERGENCY = 3,
2925 #[doc = "The remote ID system is failing or unreliable in some way."]
2926 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2927}
2928impl MavOdidStatus {
2929 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2930}
2931impl Default for MavOdidStatus {
2932 fn default() -> Self {
2933 Self::DEFAULT
2934 }
2935}
2936#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2938#[cfg_attr(feature = "serde", serde(tag = "type"))]
2939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2940#[repr(u32)]
2941pub enum MavOdidTimeAcc {
2942 #[doc = "The timestamp accuracy is unknown."]
2943 MAV_ODID_TIME_ACC_UNKNOWN = 0,
2944 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
2945 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
2946 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
2947 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
2948 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
2949 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
2950 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
2951 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
2952 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
2953 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
2954 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
2955 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
2956 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
2957 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
2958 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
2959 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
2960 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
2961 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
2962 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
2963 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
2964 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
2965 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
2966 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
2967 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
2968 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
2969 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
2970 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
2971 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
2972 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
2973 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
2974}
2975impl MavOdidTimeAcc {
2976 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
2977}
2978impl Default for MavOdidTimeAcc {
2979 fn default() -> Self {
2980 Self::DEFAULT
2981 }
2982}
2983#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2985#[cfg_attr(feature = "serde", serde(tag = "type"))]
2986#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2987#[repr(u32)]
2988pub enum MavOdidUaType {
2989 #[doc = "No UA (Unmanned Aircraft) type defined."]
2990 MAV_ODID_UA_TYPE_NONE = 0,
2991 #[doc = "Aeroplane/Airplane. Fixed wing."]
2992 MAV_ODID_UA_TYPE_AEROPLANE = 1,
2993 #[doc = "Helicopter or multirotor."]
2994 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
2995 #[doc = "Gyroplane."]
2996 MAV_ODID_UA_TYPE_GYROPLANE = 3,
2997 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
2998 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
2999 #[doc = "Ornithopter."]
3000 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3001 #[doc = "Glider."]
3002 MAV_ODID_UA_TYPE_GLIDER = 6,
3003 #[doc = "Kite."]
3004 MAV_ODID_UA_TYPE_KITE = 7,
3005 #[doc = "Free Balloon."]
3006 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3007 #[doc = "Captive Balloon."]
3008 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3009 #[doc = "Airship. E.g. a blimp."]
3010 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3011 #[doc = "Free Fall/Parachute (unpowered)."]
3012 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3013 #[doc = "Rocket."]
3014 MAV_ODID_UA_TYPE_ROCKET = 12,
3015 #[doc = "Tethered powered aircraft."]
3016 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3017 #[doc = "Ground Obstacle."]
3018 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3019 #[doc = "Other type of aircraft not listed earlier."]
3020 MAV_ODID_UA_TYPE_OTHER = 15,
3021}
3022impl MavOdidUaType {
3023 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3024}
3025impl Default for MavOdidUaType {
3026 fn default() -> Self {
3027 Self::DEFAULT
3028 }
3029}
3030#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3032#[cfg_attr(feature = "serde", serde(tag = "type"))]
3033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3034#[repr(u32)]
3035pub enum MavOdidVerAcc {
3036 #[doc = "The vertical accuracy is unknown."]
3037 MAV_ODID_VER_ACC_UNKNOWN = 0,
3038 #[doc = "The vertical accuracy is smaller than 150 meter."]
3039 MAV_ODID_VER_ACC_150_METER = 1,
3040 #[doc = "The vertical accuracy is smaller than 45 meter."]
3041 MAV_ODID_VER_ACC_45_METER = 2,
3042 #[doc = "The vertical accuracy is smaller than 25 meter."]
3043 MAV_ODID_VER_ACC_25_METER = 3,
3044 #[doc = "The vertical accuracy is smaller than 10 meter."]
3045 MAV_ODID_VER_ACC_10_METER = 4,
3046 #[doc = "The vertical accuracy is smaller than 3 meter."]
3047 MAV_ODID_VER_ACC_3_METER = 5,
3048 #[doc = "The vertical accuracy is smaller than 1 meter."]
3049 MAV_ODID_VER_ACC_1_METER = 6,
3050}
3051impl MavOdidVerAcc {
3052 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3053}
3054impl Default for MavOdidVerAcc {
3055 fn default() -> Self {
3056 Self::DEFAULT
3057 }
3058}
3059#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3060#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3061#[cfg_attr(feature = "serde", serde(tag = "type"))]
3062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3063#[repr(u32)]
3064#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3065pub enum MavParamExtType {
3066 #[doc = "8-bit unsigned integer"]
3067 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3068 #[doc = "8-bit signed integer"]
3069 MAV_PARAM_EXT_TYPE_INT8 = 2,
3070 #[doc = "16-bit unsigned integer"]
3071 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3072 #[doc = "16-bit signed integer"]
3073 MAV_PARAM_EXT_TYPE_INT16 = 4,
3074 #[doc = "32-bit unsigned integer"]
3075 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3076 #[doc = "32-bit signed integer"]
3077 MAV_PARAM_EXT_TYPE_INT32 = 6,
3078 #[doc = "64-bit unsigned integer"]
3079 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3080 #[doc = "64-bit signed integer"]
3081 MAV_PARAM_EXT_TYPE_INT64 = 8,
3082 #[doc = "32-bit floating-point"]
3083 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3084 #[doc = "64-bit floating-point"]
3085 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3086 #[doc = "Custom Type"]
3087 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3088}
3089impl MavParamExtType {
3090 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3091}
3092impl Default for MavParamExtType {
3093 fn default() -> Self {
3094 Self::DEFAULT
3095 }
3096}
3097#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3099#[cfg_attr(feature = "serde", serde(tag = "type"))]
3100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3101#[repr(u32)]
3102#[doc = "Specifies the datatype of a MAVLink parameter."]
3103pub enum MavParamType {
3104 #[doc = "8-bit unsigned integer"]
3105 MAV_PARAM_TYPE_UINT8 = 1,
3106 #[doc = "8-bit signed integer"]
3107 MAV_PARAM_TYPE_INT8 = 2,
3108 #[doc = "16-bit unsigned integer"]
3109 MAV_PARAM_TYPE_UINT16 = 3,
3110 #[doc = "16-bit signed integer"]
3111 MAV_PARAM_TYPE_INT16 = 4,
3112 #[doc = "32-bit unsigned integer"]
3113 MAV_PARAM_TYPE_UINT32 = 5,
3114 #[doc = "32-bit signed integer"]
3115 MAV_PARAM_TYPE_INT32 = 6,
3116 #[doc = "64-bit unsigned integer"]
3117 MAV_PARAM_TYPE_UINT64 = 7,
3118 #[doc = "64-bit signed integer"]
3119 MAV_PARAM_TYPE_INT64 = 8,
3120 #[doc = "32-bit floating-point"]
3121 MAV_PARAM_TYPE_REAL32 = 9,
3122 #[doc = "64-bit floating-point"]
3123 MAV_PARAM_TYPE_REAL64 = 10,
3124}
3125impl MavParamType {
3126 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3127}
3128impl Default for MavParamType {
3129 fn default() -> Self {
3130 Self::DEFAULT
3131 }
3132}
3133bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3134impl MavPowerStatus {
3135 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3136}
3137impl Default for MavPowerStatus {
3138 fn default() -> Self {
3139 Self::DEFAULT
3140 }
3141}
3142bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3143impl MavProtocolCapability {
3144 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3145}
3146impl Default for MavProtocolCapability {
3147 fn default() -> Self {
3148 Self::DEFAULT
3149 }
3150}
3151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3153#[cfg_attr(feature = "serde", serde(tag = "type"))]
3154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3155#[repr(u32)]
3156#[doc = "Result from a MAVLink command (MAV_CMD)"]
3157pub enum MavResult {
3158 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3159 MAV_RESULT_ACCEPTED = 0,
3160 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3161 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3162 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3163 MAV_RESULT_DENIED = 2,
3164 #[doc = "Command is not supported (unknown)."]
3165 MAV_RESULT_UNSUPPORTED = 3,
3166 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3167 MAV_RESULT_FAILED = 4,
3168 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3169 MAV_RESULT_IN_PROGRESS = 5,
3170 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3171 MAV_RESULT_CANCELLED = 6,
3172 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3173 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3174 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3175 MAV_RESULT_COMMAND_INT_ONLY = 8,
3176 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3177 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3178}
3179impl MavResult {
3180 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3181}
3182impl Default for MavResult {
3183 fn default() -> Self {
3184 Self::DEFAULT
3185 }
3186}
3187#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3189#[cfg_attr(feature = "serde", serde(tag = "type"))]
3190#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3191#[repr(u32)]
3192#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3193#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3194pub enum MavRoi {
3195 #[doc = "No region of interest."]
3196 MAV_ROI_NONE = 0,
3197 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3198 MAV_ROI_WPNEXT = 1,
3199 #[doc = "Point toward given waypoint."]
3200 MAV_ROI_WPINDEX = 2,
3201 #[doc = "Point toward fixed location."]
3202 MAV_ROI_LOCATION = 3,
3203 #[doc = "Point toward of given id."]
3204 MAV_ROI_TARGET = 4,
3205}
3206impl MavRoi {
3207 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3208}
3209impl Default for MavRoi {
3210 fn default() -> Self {
3211 Self::DEFAULT
3212 }
3213}
3214#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3215#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3216#[cfg_attr(feature = "serde", serde(tag = "type"))]
3217#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3218#[repr(u32)]
3219#[doc = "Enumeration of sensor orientation, according to its rotations"]
3220pub enum MavSensorOrientation {
3221 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3222 MAV_SENSOR_ROTATION_NONE = 0,
3223 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3224 MAV_SENSOR_ROTATION_YAW_45 = 1,
3225 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3226 MAV_SENSOR_ROTATION_YAW_90 = 2,
3227 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3228 MAV_SENSOR_ROTATION_YAW_135 = 3,
3229 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3230 MAV_SENSOR_ROTATION_YAW_180 = 4,
3231 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3232 MAV_SENSOR_ROTATION_YAW_225 = 5,
3233 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3234 MAV_SENSOR_ROTATION_YAW_270 = 6,
3235 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3236 MAV_SENSOR_ROTATION_YAW_315 = 7,
3237 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3238 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3239 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3240 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3241 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3242 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3243 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3244 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3245 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3246 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3247 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3248 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3249 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3250 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3251 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3252 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3253 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3254 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3255 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3256 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3257 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3258 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3259 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3260 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3261 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3262 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3263 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3264 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3265 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3266 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3267 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3268 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3269 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3270 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3271 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3272 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3273 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3274 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3275 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3276 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3277 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3278 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3279 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3280 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3281 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3282 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3283 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3284 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3285 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3286 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3287 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3288 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3289 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3290 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3291 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3292 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3293 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3294 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3295 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3296 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3297 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3298 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3299 #[doc = "Pitch: 315"]
3300 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3301 #[doc = "Roll: 90, Pitch: 315"]
3302 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3303 #[doc = "Custom orientation"]
3304 MAV_SENSOR_ROTATION_CUSTOM = 100,
3305}
3306impl MavSensorOrientation {
3307 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3308}
3309impl Default for MavSensorOrientation {
3310 fn default() -> Self {
3311 Self::DEFAULT
3312 }
3313}
3314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3316#[cfg_attr(feature = "serde", serde(tag = "type"))]
3317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3318#[repr(u32)]
3319#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3320pub enum MavSeverity {
3321 #[doc = "System is unusable. This is a \"panic\" condition."]
3322 MAV_SEVERITY_EMERGENCY = 0,
3323 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3324 MAV_SEVERITY_ALERT = 1,
3325 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3326 MAV_SEVERITY_CRITICAL = 2,
3327 #[doc = "Indicates an error in secondary/redundant systems."]
3328 MAV_SEVERITY_ERROR = 3,
3329 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3330 MAV_SEVERITY_WARNING = 4,
3331 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3332 MAV_SEVERITY_NOTICE = 5,
3333 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3334 MAV_SEVERITY_INFO = 6,
3335 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3336 MAV_SEVERITY_DEBUG = 7,
3337}
3338impl MavSeverity {
3339 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3340}
3341impl Default for MavSeverity {
3342 fn default() -> Self {
3343 Self::DEFAULT
3344 }
3345}
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3352pub enum MavStandardMode {
3353 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3354 MAV_STANDARD_MODE_NON_STANDARD = 0,
3355 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3356 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3357 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3358 MAV_STANDARD_MODE_ORBIT = 2,
3359 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3360 MAV_STANDARD_MODE_CRUISE = 3,
3361 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3362 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3363 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3364 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3365 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3366 MAV_STANDARD_MODE_MISSION = 6,
3367 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3368 MAV_STANDARD_MODE_LAND = 7,
3369 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3370 MAV_STANDARD_MODE_TAKEOFF = 8,
3371}
3372impl MavStandardMode {
3373 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3374}
3375impl Default for MavStandardMode {
3376 fn default() -> Self {
3377 Self::DEFAULT
3378 }
3379}
3380#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3381#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3382#[cfg_attr(feature = "serde", serde(tag = "type"))]
3383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3384#[repr(u32)]
3385pub enum MavState {
3386 #[doc = "Uninitialized system, state is unknown."]
3387 MAV_STATE_UNINIT = 0,
3388 #[doc = "System is booting up."]
3389 MAV_STATE_BOOT = 1,
3390 #[doc = "System is calibrating and not flight-ready."]
3391 MAV_STATE_CALIBRATING = 2,
3392 #[doc = "System is grounded and on standby. It can be launched any time."]
3393 MAV_STATE_STANDBY = 3,
3394 #[doc = "System is active and might be already airborne. Motors are engaged."]
3395 MAV_STATE_ACTIVE = 4,
3396 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3397 MAV_STATE_CRITICAL = 5,
3398 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3399 MAV_STATE_EMERGENCY = 6,
3400 #[doc = "System just initialized its power-down sequence, will shut down now."]
3401 MAV_STATE_POWEROFF = 7,
3402 #[doc = "System is terminating itself (failsafe or commanded)."]
3403 MAV_STATE_FLIGHT_TERMINATION = 8,
3404}
3405impl MavState {
3406 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3407}
3408impl Default for MavState {
3409 fn default() -> Self {
3410 Self::DEFAULT
3411 }
3412}
3413bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3414impl MavSysStatusSensor {
3415 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3416}
3417impl Default for MavSysStatusSensor {
3418 fn default() -> Self {
3419 Self::DEFAULT
3420 }
3421}
3422bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3423impl MavSysStatusSensorExtended {
3424 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3425}
3426impl Default for MavSysStatusSensorExtended {
3427 fn default() -> Self {
3428 Self::DEFAULT
3429 }
3430}
3431#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3433#[cfg_attr(feature = "serde", serde(tag = "type"))]
3434#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3435#[repr(u32)]
3436pub enum MavTunnelPayloadType {
3437 #[doc = "Encoding of payload unknown."]
3438 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3439 #[doc = "Registered for STorM32 gimbal controller."]
3440 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3441 #[doc = "Registered for STorM32 gimbal controller."]
3442 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3443 #[doc = "Registered for STorM32 gimbal controller."]
3444 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3445 #[doc = "Registered for STorM32 gimbal controller."]
3446 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3447 #[doc = "Registered for STorM32 gimbal controller."]
3448 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3449 #[doc = "Registered for STorM32 gimbal controller."]
3450 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3451 #[doc = "Registered for STorM32 gimbal controller."]
3452 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3453 #[doc = "Registered for STorM32 gimbal controller."]
3454 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3455 #[doc = "Registered for STorM32 gimbal controller."]
3456 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3457 #[doc = "Registered for STorM32 gimbal controller."]
3458 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3459 #[doc = "Registered for ModalAI remote OSD protocol."]
3460 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3461 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3462 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3463 #[doc = "Registered for ModalAI vendor use."]
3464 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3465}
3466impl MavTunnelPayloadType {
3467 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3468}
3469impl Default for MavTunnelPayloadType {
3470 fn default() -> Self {
3471 Self::DEFAULT
3472 }
3473}
3474#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3476#[cfg_attr(feature = "serde", serde(tag = "type"))]
3477#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3478#[repr(u32)]
3479#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3480pub enum MavType {
3481 #[doc = "Generic micro air vehicle"]
3482 MAV_TYPE_GENERIC = 0,
3483 #[doc = "Fixed wing aircraft."]
3484 MAV_TYPE_FIXED_WING = 1,
3485 #[doc = "Quadrotor"]
3486 MAV_TYPE_QUADROTOR = 2,
3487 #[doc = "Coaxial helicopter"]
3488 MAV_TYPE_COAXIAL = 3,
3489 #[doc = "Normal helicopter with tail rotor."]
3490 MAV_TYPE_HELICOPTER = 4,
3491 #[doc = "Ground installation"]
3492 MAV_TYPE_ANTENNA_TRACKER = 5,
3493 #[doc = "Operator control unit / ground control station"]
3494 MAV_TYPE_GCS = 6,
3495 #[doc = "Airship, controlled"]
3496 MAV_TYPE_AIRSHIP = 7,
3497 #[doc = "Free balloon, uncontrolled"]
3498 MAV_TYPE_FREE_BALLOON = 8,
3499 #[doc = "Rocket"]
3500 MAV_TYPE_ROCKET = 9,
3501 #[doc = "Ground rover"]
3502 MAV_TYPE_GROUND_ROVER = 10,
3503 #[doc = "Surface vessel, boat, ship"]
3504 MAV_TYPE_SURFACE_BOAT = 11,
3505 #[doc = "Submarine"]
3506 MAV_TYPE_SUBMARINE = 12,
3507 #[doc = "Hexarotor"]
3508 MAV_TYPE_HEXAROTOR = 13,
3509 #[doc = "Octorotor"]
3510 MAV_TYPE_OCTOROTOR = 14,
3511 #[doc = "Tricopter"]
3512 MAV_TYPE_TRICOPTER = 15,
3513 #[doc = "Flapping wing"]
3514 MAV_TYPE_FLAPPING_WING = 16,
3515 #[doc = "Kite"]
3516 MAV_TYPE_KITE = 17,
3517 #[doc = "Onboard companion controller"]
3518 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3519 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3520 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3521 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3522 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3523 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3524 MAV_TYPE_VTOL_TILTROTOR = 21,
3525 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3526 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3527 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3528 MAV_TYPE_VTOL_TAILSITTER = 23,
3529 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3530 MAV_TYPE_VTOL_TILTWING = 24,
3531 #[doc = "VTOL reserved 5"]
3532 MAV_TYPE_VTOL_RESERVED5 = 25,
3533 #[doc = "Gimbal"]
3534 MAV_TYPE_GIMBAL = 26,
3535 #[doc = "ADSB system"]
3536 MAV_TYPE_ADSB = 27,
3537 #[doc = "Steerable, nonrigid airfoil"]
3538 MAV_TYPE_PARAFOIL = 28,
3539 #[doc = "Dodecarotor"]
3540 MAV_TYPE_DODECAROTOR = 29,
3541 #[doc = "Camera"]
3542 MAV_TYPE_CAMERA = 30,
3543 #[doc = "Charging station"]
3544 MAV_TYPE_CHARGING_STATION = 31,
3545 #[doc = "FLARM collision avoidance system"]
3546 MAV_TYPE_FLARM = 32,
3547 #[doc = "Servo"]
3548 MAV_TYPE_SERVO = 33,
3549 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3550 MAV_TYPE_ODID = 34,
3551 #[doc = "Decarotor"]
3552 MAV_TYPE_DECAROTOR = 35,
3553 #[doc = "Battery"]
3554 MAV_TYPE_BATTERY = 36,
3555 #[doc = "Parachute"]
3556 MAV_TYPE_PARACHUTE = 37,
3557 #[doc = "Log"]
3558 MAV_TYPE_LOG = 38,
3559 #[doc = "OSD"]
3560 MAV_TYPE_OSD = 39,
3561 #[doc = "IMU"]
3562 MAV_TYPE_IMU = 40,
3563 #[doc = "GPS"]
3564 MAV_TYPE_GPS = 41,
3565 #[doc = "Winch"]
3566 MAV_TYPE_WINCH = 42,
3567 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3568 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3569 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3570 MAV_TYPE_ILLUMINATOR = 44,
3571 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3572 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3573}
3574impl MavType {
3575 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3576}
3577impl Default for MavType {
3578 fn default() -> Self {
3579 Self::DEFAULT
3580 }
3581}
3582#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3583#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3584#[cfg_attr(feature = "serde", serde(tag = "type"))]
3585#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3586#[repr(u32)]
3587#[doc = "Enumeration of VTOL states"]
3588pub enum MavVtolState {
3589 #[doc = "MAV is not configured as VTOL"]
3590 MAV_VTOL_STATE_UNDEFINED = 0,
3591 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3592 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3593 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3594 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3595 #[doc = "VTOL is in multicopter state"]
3596 MAV_VTOL_STATE_MC = 3,
3597 #[doc = "VTOL is in fixed-wing state"]
3598 MAV_VTOL_STATE_FW = 4,
3599}
3600impl MavVtolState {
3601 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3602}
3603impl Default for MavVtolState {
3604 fn default() -> Self {
3605 Self::DEFAULT
3606 }
3607}
3608bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3609impl MavWinchStatusFlag {
3610 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3611}
3612impl Default for MavWinchStatusFlag {
3613 fn default() -> Self {
3614 Self::DEFAULT
3615 }
3616}
3617#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3619#[cfg_attr(feature = "serde", serde(tag = "type"))]
3620#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3621#[repr(u32)]
3622pub enum MavlinkDataStreamType {
3623 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3624 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3625 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3626 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3627 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3628 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3629}
3630impl MavlinkDataStreamType {
3631 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3632}
3633impl Default for MavlinkDataStreamType {
3634 fn default() -> Self {
3635 Self::DEFAULT
3636 }
3637}
3638#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3639#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3640#[cfg_attr(feature = "serde", serde(tag = "type"))]
3641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3642#[repr(u32)]
3643#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3644pub enum MissionState {
3645 #[doc = "The mission status reporting is not supported."]
3646 MISSION_STATE_UNKNOWN = 0,
3647 #[doc = "No mission on the vehicle."]
3648 MISSION_STATE_NO_MISSION = 1,
3649 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3650 MISSION_STATE_NOT_STARTED = 2,
3651 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3652 MISSION_STATE_ACTIVE = 3,
3653 #[doc = "Mission is paused when in auto mode."]
3654 MISSION_STATE_PAUSED = 4,
3655 #[doc = "Mission has executed all mission items."]
3656 MISSION_STATE_COMPLETE = 5,
3657}
3658impl MissionState {
3659 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3660}
3661impl Default for MissionState {
3662 fn default() -> Self {
3663 Self::DEFAULT
3664 }
3665}
3666#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3668#[cfg_attr(feature = "serde", serde(tag = "type"))]
3669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3670#[repr(u32)]
3671#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3672pub enum MotorTestOrder {
3673 #[doc = "Default autopilot motor test method."]
3674 MOTOR_TEST_ORDER_DEFAULT = 0,
3675 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3676 MOTOR_TEST_ORDER_SEQUENCE = 1,
3677 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3678 MOTOR_TEST_ORDER_BOARD = 2,
3679}
3680impl MotorTestOrder {
3681 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3682}
3683impl Default for MotorTestOrder {
3684 fn default() -> Self {
3685 Self::DEFAULT
3686 }
3687}
3688#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3689#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3690#[cfg_attr(feature = "serde", serde(tag = "type"))]
3691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3692#[repr(u32)]
3693#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3694pub enum MotorTestThrottleType {
3695 #[doc = "Throttle as a percentage (0 ~ 100)"]
3696 MOTOR_TEST_THROTTLE_PERCENT = 0,
3697 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3698 MOTOR_TEST_THROTTLE_PWM = 1,
3699 #[doc = "Throttle pass-through from pilot's transmitter."]
3700 MOTOR_TEST_THROTTLE_PILOT = 2,
3701 #[doc = "Per-motor compass calibration test."]
3702 MOTOR_TEST_COMPASS_CAL = 3,
3703}
3704impl MotorTestThrottleType {
3705 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3706}
3707impl Default for MotorTestThrottleType {
3708 fn default() -> Self {
3709 Self::DEFAULT
3710 }
3711}
3712#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3714#[cfg_attr(feature = "serde", serde(tag = "type"))]
3715#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3716#[repr(u32)]
3717pub enum NavVtolLandOptions {
3718 #[doc = "Default autopilot landing behaviour."]
3719 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3720 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3721 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3722 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3723 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3724}
3725impl NavVtolLandOptions {
3726 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3727}
3728impl Default for NavVtolLandOptions {
3729 fn default() -> Self {
3730 Self::DEFAULT
3731 }
3732}
3733#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3735#[cfg_attr(feature = "serde", serde(tag = "type"))]
3736#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3737#[repr(u32)]
3738#[doc = "Yaw behaviour during orbit flight."]
3739pub enum OrbitYawBehaviour {
3740 #[doc = "Vehicle front points to the center (default)."]
3741 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3742 #[doc = "Vehicle front holds heading when message received."]
3743 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3744 #[doc = "Yaw uncontrolled."]
3745 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3746 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3747 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3748 #[doc = "Yaw controlled by RC input."]
3749 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3750 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3751 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3752}
3753impl OrbitYawBehaviour {
3754 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3755}
3756impl Default for OrbitYawBehaviour {
3757 fn default() -> Self {
3758 Self::DEFAULT
3759 }
3760}
3761#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3763#[cfg_attr(feature = "serde", serde(tag = "type"))]
3764#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3765#[repr(u32)]
3766#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3767pub enum ParachuteAction {
3768 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3769 PARACHUTE_DISABLE = 0,
3770 #[doc = "Enable auto-release of parachute."]
3771 PARACHUTE_ENABLE = 1,
3772 #[doc = "Release parachute and kill motors."]
3773 PARACHUTE_RELEASE = 2,
3774}
3775impl ParachuteAction {
3776 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3777}
3778impl Default for ParachuteAction {
3779 fn default() -> Self {
3780 Self::DEFAULT
3781 }
3782}
3783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3785#[cfg_attr(feature = "serde", serde(tag = "type"))]
3786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3787#[repr(u32)]
3788#[doc = "Result from PARAM_EXT_SET message."]
3789pub enum ParamAck {
3790 #[doc = "Parameter value ACCEPTED and SET"]
3791 PARAM_ACK_ACCEPTED = 0,
3792 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3793 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3794 #[doc = "Parameter failed to set"]
3795 PARAM_ACK_FAILED = 2,
3796 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3797 PARAM_ACK_IN_PROGRESS = 3,
3798}
3799impl ParamAck {
3800 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3801}
3802impl Default for ParamAck {
3803 fn default() -> Self {
3804 Self::DEFAULT
3805 }
3806}
3807bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3808impl PositionTargetTypemask {
3809 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3810}
3811impl Default for PositionTargetTypemask {
3812 fn default() -> Self {
3813 Self::DEFAULT
3814 }
3815}
3816#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3817#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3818#[cfg_attr(feature = "serde", serde(tag = "type"))]
3819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3820#[repr(u32)]
3821#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3822pub enum PrecisionLandMode {
3823 #[doc = "Normal (non-precision) landing."]
3824 PRECISION_LAND_MODE_DISABLED = 0,
3825 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3826 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3827 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3828 PRECISION_LAND_MODE_REQUIRED = 2,
3829}
3830impl PrecisionLandMode {
3831 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3832}
3833impl Default for PrecisionLandMode {
3834 fn default() -> Self {
3835 Self::DEFAULT
3836 }
3837}
3838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3840#[cfg_attr(feature = "serde", serde(tag = "type"))]
3841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3842#[repr(u32)]
3843#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3844pub enum PreflightStorageMissionAction {
3845 #[doc = "Read current mission data from persistent storage"]
3846 MISSION_READ_PERSISTENT = 0,
3847 #[doc = "Write current mission data to persistent storage"]
3848 MISSION_WRITE_PERSISTENT = 1,
3849 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3850 MISSION_RESET_DEFAULT = 2,
3851}
3852impl PreflightStorageMissionAction {
3853 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3854}
3855impl Default for PreflightStorageMissionAction {
3856 fn default() -> Self {
3857 Self::DEFAULT
3858 }
3859}
3860#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3862#[cfg_attr(feature = "serde", serde(tag = "type"))]
3863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3864#[repr(u32)]
3865#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3866pub enum PreflightStorageParameterAction {
3867 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3868 PARAM_READ_PERSISTENT = 0,
3869 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3870 PARAM_WRITE_PERSISTENT = 1,
3871 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3872 PARAM_RESET_CONFIG_DEFAULT = 2,
3873 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3874 PARAM_RESET_SENSOR_DEFAULT = 3,
3875 #[doc = "Reset all parameters, including operation counters, to default values"]
3876 PARAM_RESET_ALL_DEFAULT = 4,
3877}
3878impl PreflightStorageParameterAction {
3879 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3880}
3881impl Default for PreflightStorageParameterAction {
3882 fn default() -> Self {
3883 Self::DEFAULT
3884 }
3885}
3886#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3887#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3888#[cfg_attr(feature = "serde", serde(tag = "type"))]
3889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3890#[repr(u32)]
3891#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3892pub enum RcSubType {
3893 #[doc = "Spektrum DSM2"]
3894 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
3895 #[doc = "Spektrum DSMX"]
3896 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
3897 #[doc = "Spektrum DSMX8"]
3898 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
3899}
3900impl RcSubType {
3901 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
3902}
3903impl Default for RcSubType {
3904 fn default() -> Self {
3905 Self::DEFAULT
3906 }
3907}
3908#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3909#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3910#[cfg_attr(feature = "serde", serde(tag = "type"))]
3911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3912#[repr(u32)]
3913#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
3914pub enum RcType {
3915 #[doc = "Spektrum"]
3916 RC_TYPE_SPEKTRUM = 0,
3917 #[doc = "CRSF"]
3918 RC_TYPE_CRSF = 1,
3919}
3920impl RcType {
3921 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
3922}
3923impl Default for RcType {
3924 fn default() -> Self {
3925 Self::DEFAULT
3926 }
3927}
3928#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3930#[cfg_attr(feature = "serde", serde(tag = "type"))]
3931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3932#[repr(u32)]
3933#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
3934pub enum RebootShutdownConditions {
3935 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
3936 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
3937 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
3938 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
3939}
3940impl RebootShutdownConditions {
3941 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
3942}
3943impl Default for RebootShutdownConditions {
3944 fn default() -> Self {
3945 Self::DEFAULT
3946 }
3947}
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
3954pub enum RtkBaselineCoordinateSystem {
3955 #[doc = "Earth-centered, Earth-fixed"]
3956 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
3957 #[doc = "RTK basestation centered, north, east, down"]
3958 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
3959}
3960impl RtkBaselineCoordinateSystem {
3961 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
3962}
3963impl Default for RtkBaselineCoordinateSystem {
3964 fn default() -> Self {
3965 Self::DEFAULT
3966 }
3967}
3968#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3970#[cfg_attr(feature = "serde", serde(tag = "type"))]
3971#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3972#[repr(u32)]
3973#[doc = "Possible safety switch states."]
3974pub enum SafetySwitchState {
3975 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
3976 SAFETY_SWITCH_STATE_SAFE = 0,
3977 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
3978 SAFETY_SWITCH_STATE_DANGEROUS = 1,
3979}
3980impl SafetySwitchState {
3981 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
3982}
3983impl Default for SafetySwitchState {
3984 fn default() -> Self {
3985 Self::DEFAULT
3986 }
3987}
3988#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3989#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3990#[cfg_attr(feature = "serde", serde(tag = "type"))]
3991#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3992#[repr(u32)]
3993#[doc = "SERIAL_CONTROL device types"]
3994pub enum SerialControlDev {
3995 #[doc = "First telemetry port"]
3996 SERIAL_CONTROL_DEV_TELEM1 = 0,
3997 #[doc = "Second telemetry port"]
3998 SERIAL_CONTROL_DEV_TELEM2 = 1,
3999 #[doc = "First GPS port"]
4000 SERIAL_CONTROL_DEV_GPS1 = 2,
4001 #[doc = "Second GPS port"]
4002 SERIAL_CONTROL_DEV_GPS2 = 3,
4003 #[doc = "system shell"]
4004 SERIAL_CONTROL_DEV_SHELL = 10,
4005 #[doc = "SERIAL0"]
4006 SERIAL_CONTROL_SERIAL0 = 100,
4007 #[doc = "SERIAL1"]
4008 SERIAL_CONTROL_SERIAL1 = 101,
4009 #[doc = "SERIAL2"]
4010 SERIAL_CONTROL_SERIAL2 = 102,
4011 #[doc = "SERIAL3"]
4012 SERIAL_CONTROL_SERIAL3 = 103,
4013 #[doc = "SERIAL4"]
4014 SERIAL_CONTROL_SERIAL4 = 104,
4015 #[doc = "SERIAL5"]
4016 SERIAL_CONTROL_SERIAL5 = 105,
4017 #[doc = "SERIAL6"]
4018 SERIAL_CONTROL_SERIAL6 = 106,
4019 #[doc = "SERIAL7"]
4020 SERIAL_CONTROL_SERIAL7 = 107,
4021 #[doc = "SERIAL8"]
4022 SERIAL_CONTROL_SERIAL8 = 108,
4023 #[doc = "SERIAL9"]
4024 SERIAL_CONTROL_SERIAL9 = 109,
4025}
4026impl SerialControlDev {
4027 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4028}
4029impl Default for SerialControlDev {
4030 fn default() -> Self {
4031 Self::DEFAULT
4032 }
4033}
4034bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4035impl SerialControlFlag {
4036 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4037}
4038impl Default for SerialControlFlag {
4039 fn default() -> Self {
4040 Self::DEFAULT
4041 }
4042}
4043#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4045#[cfg_attr(feature = "serde", serde(tag = "type"))]
4046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4047#[repr(u32)]
4048#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4049pub enum SetFocusType {
4050 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4051 FOCUS_TYPE_STEP = 0,
4052 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4053 FOCUS_TYPE_CONTINUOUS = 1,
4054 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4055 FOCUS_TYPE_RANGE = 2,
4056 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4057 FOCUS_TYPE_METERS = 3,
4058 #[doc = "Focus automatically."]
4059 FOCUS_TYPE_AUTO = 4,
4060 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4061 FOCUS_TYPE_AUTO_SINGLE = 5,
4062 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4063 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4064}
4065impl SetFocusType {
4066 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4067}
4068impl Default for SetFocusType {
4069 fn default() -> Self {
4070 Self::DEFAULT
4071 }
4072}
4073#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4075#[cfg_attr(feature = "serde", serde(tag = "type"))]
4076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4077#[repr(u32)]
4078#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4079pub enum SpeedType {
4080 #[doc = "Airspeed"]
4081 SPEED_TYPE_AIRSPEED = 0,
4082 #[doc = "Groundspeed"]
4083 SPEED_TYPE_GROUNDSPEED = 1,
4084 #[doc = "Climb speed"]
4085 SPEED_TYPE_CLIMB_SPEED = 2,
4086 #[doc = "Descent speed"]
4087 SPEED_TYPE_DESCENT_SPEED = 3,
4088}
4089impl SpeedType {
4090 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4091}
4092impl Default for SpeedType {
4093 fn default() -> Self {
4094 Self::DEFAULT
4095 }
4096}
4097#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4099#[cfg_attr(feature = "serde", serde(tag = "type"))]
4100#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4101#[repr(u32)]
4102#[doc = "Flags to indicate the status of camera storage."]
4103pub enum StorageStatus {
4104 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4105 STORAGE_STATUS_EMPTY = 0,
4106 #[doc = "Storage present but unformatted."]
4107 STORAGE_STATUS_UNFORMATTED = 1,
4108 #[doc = "Storage present and ready."]
4109 STORAGE_STATUS_READY = 2,
4110 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4111 STORAGE_STATUS_NOT_SUPPORTED = 3,
4112}
4113impl StorageStatus {
4114 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4115}
4116impl Default for StorageStatus {
4117 fn default() -> Self {
4118 Self::DEFAULT
4119 }
4120}
4121#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4123#[cfg_attr(feature = "serde", serde(tag = "type"))]
4124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4125#[repr(u32)]
4126#[doc = "Flags to indicate the type of storage."]
4127pub enum StorageType {
4128 #[doc = "Storage type is not known."]
4129 STORAGE_TYPE_UNKNOWN = 0,
4130 #[doc = "Storage type is USB device."]
4131 STORAGE_TYPE_USB_STICK = 1,
4132 #[doc = "Storage type is SD card."]
4133 STORAGE_TYPE_SD = 2,
4134 #[doc = "Storage type is microSD card."]
4135 STORAGE_TYPE_MICROSD = 3,
4136 #[doc = "Storage type is CFast."]
4137 STORAGE_TYPE_CF = 4,
4138 #[doc = "Storage type is CFexpress."]
4139 STORAGE_TYPE_CFE = 5,
4140 #[doc = "Storage type is XQD."]
4141 STORAGE_TYPE_XQD = 6,
4142 #[doc = "Storage type is HD mass storage type."]
4143 STORAGE_TYPE_HD = 7,
4144 #[doc = "Storage type is other, not listed type."]
4145 STORAGE_TYPE_OTHER = 254,
4146}
4147impl StorageType {
4148 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4149}
4150impl Default for StorageType {
4151 fn default() -> Self {
4152 Self::DEFAULT
4153 }
4154}
4155bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4156impl StorageUsageFlag {
4157 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4158}
4159impl Default for StorageUsageFlag {
4160 fn default() -> Self {
4161 Self::DEFAULT
4162 }
4163}
4164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4166#[cfg_attr(feature = "serde", serde(tag = "type"))]
4167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4168#[repr(u32)]
4169#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4170pub enum TuneFormat {
4171 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4172 TUNE_FORMAT_QBASIC1_1 = 1,
4173 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4174 TUNE_FORMAT_MML_MODERN = 2,
4175}
4176impl TuneFormat {
4177 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4178}
4179impl Default for TuneFormat {
4180 fn default() -> Self {
4181 Self::DEFAULT
4182 }
4183}
4184#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4186#[cfg_attr(feature = "serde", serde(tag = "type"))]
4187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4188#[repr(u32)]
4189#[doc = "Generalized UAVCAN node health"]
4190pub enum UavcanNodeHealth {
4191 #[doc = "The node is functioning properly."]
4192 UAVCAN_NODE_HEALTH_OK = 0,
4193 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4194 UAVCAN_NODE_HEALTH_WARNING = 1,
4195 #[doc = "The node has encountered a major failure."]
4196 UAVCAN_NODE_HEALTH_ERROR = 2,
4197 #[doc = "The node has suffered a fatal malfunction."]
4198 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4199}
4200impl UavcanNodeHealth {
4201 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4202}
4203impl Default for UavcanNodeHealth {
4204 fn default() -> Self {
4205 Self::DEFAULT
4206 }
4207}
4208#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4210#[cfg_attr(feature = "serde", serde(tag = "type"))]
4211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4212#[repr(u32)]
4213#[doc = "Generalized UAVCAN node mode"]
4214pub enum UavcanNodeMode {
4215 #[doc = "The node is performing its primary functions."]
4216 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4217 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4218 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4219 #[doc = "The node is under maintenance."]
4220 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4221 #[doc = "The node is in the process of updating its software."]
4222 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4223 #[doc = "The node is no longer available online."]
4224 UAVCAN_NODE_MODE_OFFLINE = 7,
4225}
4226impl UavcanNodeMode {
4227 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4228}
4229impl Default for UavcanNodeMode {
4230 fn default() -> Self {
4231 Self::DEFAULT
4232 }
4233}
4234#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4235#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4236#[cfg_attr(feature = "serde", serde(tag = "type"))]
4237#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4238#[repr(u32)]
4239#[doc = "Emergency status encoding"]
4240pub enum UavionixAdsbEmergencyStatus {
4241 UAVIONIX_ADSB_OUT_NO_EMERGENCY = 0,
4242 UAVIONIX_ADSB_OUT_GENERAL_EMERGENCY = 1,
4243 UAVIONIX_ADSB_OUT_LIFEGUARD_EMERGENCY = 2,
4244 UAVIONIX_ADSB_OUT_MINIMUM_FUEL_EMERGENCY = 3,
4245 UAVIONIX_ADSB_OUT_NO_COMM_EMERGENCY = 4,
4246 UAVIONIX_ADSB_OUT_UNLAWFUL_INTERFERANCE_EMERGENCY = 5,
4247 UAVIONIX_ADSB_OUT_DOWNED_AIRCRAFT_EMERGENCY = 6,
4248 UAVIONIX_ADSB_OUT_RESERVED = 7,
4249}
4250impl UavionixAdsbEmergencyStatus {
4251 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_NO_EMERGENCY;
4252}
4253impl Default for UavionixAdsbEmergencyStatus {
4254 fn default() -> Self {
4255 Self::DEFAULT
4256 }
4257}
4258#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4260#[cfg_attr(feature = "serde", serde(tag = "type"))]
4261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4262#[repr(u32)]
4263#[doc = "Definitions for aircraft size"]
4264pub enum UavionixAdsbOutCfgAircraftSize {
4265 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA = 0,
4266 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L15M_W23M = 1,
4267 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25M_W28P5M = 2,
4268 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L25_34M = 3,
4269 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_33M = 4,
4270 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L35_38M = 5,
4271 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_39P5M = 6,
4272 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L45_45M = 7,
4273 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_45M = 8,
4274 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L55_52M = 9,
4275 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_59P5M = 10,
4276 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L65_67M = 11,
4277 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W72P5M = 12,
4278 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L75_W80M = 13,
4279 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W80M = 14,
4280 UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_L85_W90M = 15,
4281}
4282impl UavionixAdsbOutCfgAircraftSize {
4283 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_AIRCRAFT_SIZE_NO_DATA;
4284}
4285impl Default for UavionixAdsbOutCfgAircraftSize {
4286 fn default() -> Self {
4287 Self::DEFAULT
4288 }
4289}
4290#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4291#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4292#[cfg_attr(feature = "serde", serde(tag = "type"))]
4293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4294#[repr(u32)]
4295#[doc = "GPS lataral offset encoding"]
4296pub enum UavionixAdsbOutCfgGpsOffsetLat {
4297 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA = 0,
4298 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_2M = 1,
4299 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_4M = 2,
4300 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_LEFT_6M = 3,
4301 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_0M = 4,
4302 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_2M = 5,
4303 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_4M = 6,
4304 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_RIGHT_6M = 7,
4305}
4306impl UavionixAdsbOutCfgGpsOffsetLat {
4307 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LAT_NO_DATA;
4308}
4309impl Default for UavionixAdsbOutCfgGpsOffsetLat {
4310 fn default() -> Self {
4311 Self::DEFAULT
4312 }
4313}
4314#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4315#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4316#[cfg_attr(feature = "serde", serde(tag = "type"))]
4317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4318#[repr(u32)]
4319#[doc = "GPS longitudinal offset encoding"]
4320pub enum UavionixAdsbOutCfgGpsOffsetLon {
4321 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA = 0,
4322 UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_APPLIED_BY_SENSOR = 1,
4323}
4324impl UavionixAdsbOutCfgGpsOffsetLon {
4325 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CFG_GPS_OFFSET_LON_NO_DATA;
4326}
4327impl Default for UavionixAdsbOutCfgGpsOffsetLon {
4328 fn default() -> Self {
4329 Self::DEFAULT
4330 }
4331}
4332bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder dynamic report"] pub struct UavionixAdsbOutControlState : u8 { const UAVIONIX_ADSB_OUT_CONTROL_STATE_EXTERNAL_BARO_CROSSCHECKED = 1 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_ON_GROUND = 4 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_IDENT_BUTTON_ACTIVE = 8 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_A_ENABLED = 16 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_C_ENABLED = 32 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_MODE_S_ENABLED = 64 ; const UAVIONIX_ADSB_OUT_CONTROL_STATE_1090ES_TX_ENABLED = 128 ; } }
4333impl UavionixAdsbOutControlState {
4334 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_CONTROL_STATE_EXTERNAL_BARO_CROSSCHECKED;
4335}
4336impl Default for UavionixAdsbOutControlState {
4337 fn default() -> Self {
4338 Self::DEFAULT
4339 }
4340}
4341#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4343#[cfg_attr(feature = "serde", serde(tag = "type"))]
4344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4345#[repr(u32)]
4346#[doc = "Status for ADS-B transponder dynamic input"]
4347pub enum UavionixAdsbOutDynamicGpsFix {
4348 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0 = 0,
4349 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_1 = 1,
4350 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_2D = 2,
4351 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_3D = 3,
4352 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_DGPS = 4,
4353 UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_RTK = 5,
4354}
4355impl UavionixAdsbOutDynamicGpsFix {
4356 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_DYNAMIC_GPS_FIX_NONE_0;
4357}
4358impl Default for UavionixAdsbOutDynamicGpsFix {
4359 fn default() -> Self {
4360 Self::DEFAULT
4361 }
4362}
4363bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder dynamic report"] pub struct UavionixAdsbOutDynamicState : u16 { const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE = 1 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_AUTOPILOT_ENABLED = 2 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_NICBARO_CROSSCHECKED = 4 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_ON_GROUND = 8 ; const UAVIONIX_ADSB_OUT_DYNAMIC_STATE_IDENT = 16 ; } }
4364impl UavionixAdsbOutDynamicState {
4365 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_DYNAMIC_STATE_INTENT_CHANGE;
4366}
4367impl Default for UavionixAdsbOutDynamicState {
4368 fn default() -> Self {
4369 Self::DEFAULT
4370 }
4371}
4372bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Transceiver RF control flags for ADS-B transponder dynamic reports"] pub struct UavionixAdsbOutRfSelect : u8 { const UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED = 1 ; const UAVIONIX_ADSB_OUT_RF_SELECT_TX_ENABLED = 2 ; } }
4373impl UavionixAdsbOutRfSelect {
4374 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_RF_SELECT_RX_ENABLED;
4375}
4376impl Default for UavionixAdsbOutRfSelect {
4377 fn default() -> Self {
4378 Self::DEFAULT
4379 }
4380}
4381bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder fault report"] pub struct UavionixAdsbOutStatusFault : u8 { const UAVIONIX_ADSB_OUT_STATUS_FAULT_STATUS_MESSAGE_UNAVAIL = 8 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_GPS_NO_POS = 16 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_GPS_UNAVAIL = 32 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_TX_SYSTEM_FAIL = 64 ; const UAVIONIX_ADSB_OUT_STATUS_FAULT_MAINT_REQ = 128 ; } }
4382impl UavionixAdsbOutStatusFault {
4383 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_STATUS_FAULT_STATUS_MESSAGE_UNAVAIL;
4384}
4385impl Default for UavionixAdsbOutStatusFault {
4386 fn default() -> Self {
4387 Self::DEFAULT
4388 }
4389}
4390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4392#[cfg_attr(feature = "serde", serde(tag = "type"))]
4393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4394#[repr(u32)]
4395#[doc = "State flags for ADS-B transponder status report"]
4396pub enum UavionixAdsbOutStatusNicNacp {
4397 UAVIONIX_ADSB_NIC_CR_20_NM = 1,
4398 UAVIONIX_ADSB_NIC_CR_8_NM = 2,
4399 UAVIONIX_ADSB_NIC_CR_4_NM = 3,
4400 UAVIONIX_ADSB_NIC_CR_2_NM = 4,
4401 UAVIONIX_ADSB_NIC_CR_1_NM = 5,
4402 UAVIONIX_ADSB_NIC_CR_0_3_NM = 6,
4403 UAVIONIX_ADSB_NIC_CR_0_2_NM = 7,
4404 UAVIONIX_ADSB_NIC_CR_0_1_NM = 8,
4405 UAVIONIX_ADSB_NIC_CR_75_M = 9,
4406 UAVIONIX_ADSB_NIC_CR_25_M = 10,
4407 UAVIONIX_ADSB_NIC_CR_7_5_M = 11,
4408 UAVIONIX_ADSB_NACP_EPU_10_NM = 16,
4409 UAVIONIX_ADSB_NACP_EPU_4_NM = 32,
4410 UAVIONIX_ADSB_NACP_EPU_2_NM = 48,
4411 UAVIONIX_ADSB_NACP_EPU_1_NM = 64,
4412 UAVIONIX_ADSB_NACP_EPU_0_5_NM = 80,
4413 UAVIONIX_ADSB_NACP_EPU_0_3_NM = 96,
4414 UAVIONIX_ADSB_NACP_EPU_0_1_NM = 112,
4415 UAVIONIX_ADSB_NACP_EPU_0_05_NM = 128,
4416 UAVIONIX_ADSB_NACP_EPU_30_M = 144,
4417 UAVIONIX_ADSB_NACP_EPU_10_M = 160,
4418 UAVIONIX_ADSB_NACP_EPU_3_M = 176,
4419}
4420impl UavionixAdsbOutStatusNicNacp {
4421 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_NIC_CR_20_NM;
4422}
4423impl Default for UavionixAdsbOutStatusNicNacp {
4424 fn default() -> Self {
4425 Self::DEFAULT
4426 }
4427}
4428bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for ADS-B transponder status report"] pub struct UavionixAdsbOutStatusState : u8 { const UAVIONIX_ADSB_OUT_STATUS_STATE_ON_GROUND = 1 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_INTERROGATED_SINCE_LAST = 2 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_XBIT_ENABLED = 4 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_IDENT_ACTIVE = 8 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_A_ENABLED = 16 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_C_ENABLED = 32 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_MODE_S_ENABLED = 64 ; const UAVIONIX_ADSB_OUT_STATUS_STATE_1090ES_TX_ENABLED = 128 ; } }
4429impl UavionixAdsbOutStatusState {
4430 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_OUT_STATUS_STATE_ON_GROUND;
4431}
4432impl Default for UavionixAdsbOutStatusState {
4433 fn default() -> Self {
4434 Self::DEFAULT
4435 }
4436}
4437bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Status flags for ADS-B transponder dynamic output"] pub struct UavionixAdsbRfHealth : u8 { const UAVIONIX_ADSB_RF_HEALTH_OK = 1 ; const UAVIONIX_ADSB_RF_HEALTH_FAIL_TX = 2 ; const UAVIONIX_ADSB_RF_HEALTH_FAIL_RX = 16 ; } }
4438impl UavionixAdsbRfHealth {
4439 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_RF_HEALTH_OK;
4440}
4441impl Default for UavionixAdsbRfHealth {
4442 fn default() -> Self {
4443 Self::DEFAULT
4444 }
4445}
4446bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "State flags for X-Bit and reserved fields."] pub struct UavionixAdsbXbit : u8 { const UAVIONIX_ADSB_XBIT_ENABLED = 128 ; } }
4447impl UavionixAdsbXbit {
4448 pub const DEFAULT: Self = Self::UAVIONIX_ADSB_XBIT_ENABLED;
4449}
4450impl Default for UavionixAdsbXbit {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4456impl UtmDataAvailFlags {
4457 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4458}
4459impl Default for UtmDataAvailFlags {
4460 fn default() -> Self {
4461 Self::DEFAULT
4462 }
4463}
4464#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4466#[cfg_attr(feature = "serde", serde(tag = "type"))]
4467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4468#[repr(u32)]
4469#[doc = "Airborne status of UAS."]
4470pub enum UtmFlightState {
4471 #[doc = "The flight state can't be determined."]
4472 UTM_FLIGHT_STATE_UNKNOWN = 1,
4473 #[doc = "UAS on ground."]
4474 UTM_FLIGHT_STATE_GROUND = 2,
4475 #[doc = "UAS airborne."]
4476 UTM_FLIGHT_STATE_AIRBORNE = 3,
4477 #[doc = "UAS is in an emergency flight state."]
4478 UTM_FLIGHT_STATE_EMERGENCY = 16,
4479 #[doc = "UAS has no active controls."]
4480 UTM_FLIGHT_STATE_NOCTRL = 32,
4481}
4482impl UtmFlightState {
4483 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4484}
4485impl Default for UtmFlightState {
4486 fn default() -> Self {
4487 Self::DEFAULT
4488 }
4489}
4490#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4492#[cfg_attr(feature = "serde", serde(tag = "type"))]
4493#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4494#[repr(u32)]
4495#[doc = "Video stream encodings"]
4496pub enum VideoStreamEncoding {
4497 #[doc = "Stream encoding is unknown"]
4498 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4499 #[doc = "Stream encoding is H.264"]
4500 VIDEO_STREAM_ENCODING_H264 = 1,
4501 #[doc = "Stream encoding is H.265"]
4502 VIDEO_STREAM_ENCODING_H265 = 2,
4503}
4504impl VideoStreamEncoding {
4505 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4506}
4507impl Default for VideoStreamEncoding {
4508 fn default() -> Self {
4509 Self::DEFAULT
4510 }
4511}
4512bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4513impl VideoStreamStatusFlags {
4514 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4515}
4516impl Default for VideoStreamStatusFlags {
4517 fn default() -> Self {
4518 Self::DEFAULT
4519 }
4520}
4521#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4523#[cfg_attr(feature = "serde", serde(tag = "type"))]
4524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4525#[repr(u32)]
4526#[doc = "Video stream types"]
4527pub enum VideoStreamType {
4528 #[doc = "Stream is RTSP"]
4529 VIDEO_STREAM_TYPE_RTSP = 0,
4530 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4531 VIDEO_STREAM_TYPE_RTPUDP = 1,
4532 #[doc = "Stream is MPEG on TCP"]
4533 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4534 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4535 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4536}
4537impl VideoStreamType {
4538 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4539}
4540impl Default for VideoStreamType {
4541 fn default() -> Self {
4542 Self::DEFAULT
4543 }
4544}
4545#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4546#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4547#[cfg_attr(feature = "serde", serde(tag = "type"))]
4548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4549#[repr(u32)]
4550#[doc = "Direction of VTOL transition"]
4551pub enum VtolTransitionHeading {
4552 #[doc = "Respect the heading configuration of the vehicle."]
4553 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4554 #[doc = "Use the heading pointing towards the next waypoint."]
4555 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4556 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4557 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4558 #[doc = "Use the specified heading in parameter 4."]
4559 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4560 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4561 VTOL_TRANSITION_HEADING_ANY = 4,
4562}
4563impl VtolTransitionHeading {
4564 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4565}
4566impl Default for VtolTransitionHeading {
4567 fn default() -> Self {
4568 Self::DEFAULT
4569 }
4570}
4571#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4573#[cfg_attr(feature = "serde", serde(tag = "type"))]
4574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4575#[repr(u32)]
4576#[doc = "WiFi Mode."]
4577pub enum WifiConfigApMode {
4578 #[doc = "WiFi mode is undefined."]
4579 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4580 #[doc = "WiFi configured as an access point."]
4581 WIFI_CONFIG_AP_MODE_AP = 1,
4582 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4583 WIFI_CONFIG_AP_MODE_STATION = 2,
4584 #[doc = "WiFi disabled."]
4585 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4586}
4587impl WifiConfigApMode {
4588 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4589}
4590impl Default for WifiConfigApMode {
4591 fn default() -> Self {
4592 Self::DEFAULT
4593 }
4594}
4595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4597#[cfg_attr(feature = "serde", serde(tag = "type"))]
4598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4599#[repr(u32)]
4600#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4601pub enum WifiConfigApResponse {
4602 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4603 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4604 #[doc = "Changes accepted."]
4605 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4606 #[doc = "Changes rejected."]
4607 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4608 #[doc = "Invalid Mode."]
4609 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4610 #[doc = "Invalid SSID."]
4611 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4612 #[doc = "Invalid Password."]
4613 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4614}
4615impl WifiConfigApResponse {
4616 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4617}
4618impl Default for WifiConfigApResponse {
4619 fn default() -> Self {
4620 Self::DEFAULT
4621 }
4622}
4623#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4625#[cfg_attr(feature = "serde", serde(tag = "type"))]
4626#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4627#[repr(u32)]
4628#[doc = "Winch actions."]
4629pub enum WinchActions {
4630 #[doc = "Allow motor to freewheel."]
4631 WINCH_RELAXED = 0,
4632 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4633 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4634 #[doc = "Wind or unwind line at specified rate."]
4635 WINCH_RATE_CONTROL = 2,
4636 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4637 WINCH_LOCK = 3,
4638 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4639 WINCH_DELIVER = 4,
4640 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4641 WINCH_HOLD = 5,
4642 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4643 WINCH_RETRACT = 6,
4644 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4645 WINCH_LOAD_LINE = 7,
4646 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4647 WINCH_ABANDON_LINE = 8,
4648 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4649 WINCH_LOAD_PAYLOAD = 9,
4650}
4651impl WinchActions {
4652 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4653}
4654impl Default for WinchActions {
4655 fn default() -> Self {
4656 Self::DEFAULT
4657 }
4658}
4659#[doc = "id: 140"]
4660#[doc = "Set the vehicle attitude and body angular rates."]
4661#[derive(Debug, Clone, PartialEq)]
4662#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4663#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4664pub struct ACTUATOR_CONTROL_TARGET_DATA {
4665 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4666 pub time_usec: u64,
4667 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4668 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4669 pub controls: [f32; 8],
4670 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4671 pub group_mlx: u8,
4672}
4673impl ACTUATOR_CONTROL_TARGET_DATA {
4674 pub const ENCODED_LEN: usize = 41usize;
4675 pub const DEFAULT: Self = Self {
4676 time_usec: 0_u64,
4677 controls: [0.0_f32; 8usize],
4678 group_mlx: 0_u8,
4679 };
4680 #[cfg(feature = "arbitrary")]
4681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4682 use arbitrary::{Arbitrary, Unstructured};
4683 let mut buf = [0u8; 1024];
4684 rng.fill_bytes(&mut buf);
4685 let mut unstructured = Unstructured::new(&buf);
4686 Self::arbitrary(&mut unstructured).unwrap_or_default()
4687 }
4688}
4689impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4690 fn default() -> Self {
4691 Self::DEFAULT.clone()
4692 }
4693}
4694impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4695 type Message = MavMessage;
4696 const ID: u32 = 140u32;
4697 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4698 const EXTRA_CRC: u8 = 181u8;
4699 const ENCODED_LEN: usize = 41usize;
4700 fn deser(
4701 _version: MavlinkVersion,
4702 __input: &[u8],
4703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4704 let avail_len = __input.len();
4705 let mut payload_buf = [0; Self::ENCODED_LEN];
4706 let mut buf = if avail_len < Self::ENCODED_LEN {
4707 payload_buf[0..avail_len].copy_from_slice(__input);
4708 Bytes::new(&payload_buf)
4709 } else {
4710 Bytes::new(__input)
4711 };
4712 let mut __struct = Self::default();
4713 __struct.time_usec = buf.get_u64_le();
4714 for v in &mut __struct.controls {
4715 let val = buf.get_f32_le();
4716 *v = val;
4717 }
4718 __struct.group_mlx = buf.get_u8();
4719 Ok(__struct)
4720 }
4721 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4722 let mut __tmp = BytesMut::new(bytes);
4723 #[allow(clippy::absurd_extreme_comparisons)]
4724 #[allow(unused_comparisons)]
4725 if __tmp.remaining() < Self::ENCODED_LEN {
4726 panic!(
4727 "buffer is too small (need {} bytes, but got {})",
4728 Self::ENCODED_LEN,
4729 __tmp.remaining(),
4730 )
4731 }
4732 __tmp.put_u64_le(self.time_usec);
4733 for val in &self.controls {
4734 __tmp.put_f32_le(*val);
4735 }
4736 __tmp.put_u8(self.group_mlx);
4737 if matches!(version, MavlinkVersion::V2) {
4738 let len = __tmp.len();
4739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4740 } else {
4741 __tmp.len()
4742 }
4743 }
4744}
4745#[doc = "id: 375"]
4746#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4747#[derive(Debug, Clone, PartialEq)]
4748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4750pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4751 #[doc = "Timestamp (since system boot)."]
4752 pub time_usec: u64,
4753 #[doc = "Active outputs"]
4754 pub active: u32,
4755 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4756 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4757 pub actuator: [f32; 32],
4758}
4759impl ACTUATOR_OUTPUT_STATUS_DATA {
4760 pub const ENCODED_LEN: usize = 140usize;
4761 pub const DEFAULT: Self = Self {
4762 time_usec: 0_u64,
4763 active: 0_u32,
4764 actuator: [0.0_f32; 32usize],
4765 };
4766 #[cfg(feature = "arbitrary")]
4767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4768 use arbitrary::{Arbitrary, Unstructured};
4769 let mut buf = [0u8; 1024];
4770 rng.fill_bytes(&mut buf);
4771 let mut unstructured = Unstructured::new(&buf);
4772 Self::arbitrary(&mut unstructured).unwrap_or_default()
4773 }
4774}
4775impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4776 fn default() -> Self {
4777 Self::DEFAULT.clone()
4778 }
4779}
4780impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4781 type Message = MavMessage;
4782 const ID: u32 = 375u32;
4783 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4784 const EXTRA_CRC: u8 = 251u8;
4785 const ENCODED_LEN: usize = 140usize;
4786 fn deser(
4787 _version: MavlinkVersion,
4788 __input: &[u8],
4789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4790 let avail_len = __input.len();
4791 let mut payload_buf = [0; Self::ENCODED_LEN];
4792 let mut buf = if avail_len < Self::ENCODED_LEN {
4793 payload_buf[0..avail_len].copy_from_slice(__input);
4794 Bytes::new(&payload_buf)
4795 } else {
4796 Bytes::new(__input)
4797 };
4798 let mut __struct = Self::default();
4799 __struct.time_usec = buf.get_u64_le();
4800 __struct.active = buf.get_u32_le();
4801 for v in &mut __struct.actuator {
4802 let val = buf.get_f32_le();
4803 *v = val;
4804 }
4805 Ok(__struct)
4806 }
4807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4808 let mut __tmp = BytesMut::new(bytes);
4809 #[allow(clippy::absurd_extreme_comparisons)]
4810 #[allow(unused_comparisons)]
4811 if __tmp.remaining() < Self::ENCODED_LEN {
4812 panic!(
4813 "buffer is too small (need {} bytes, but got {})",
4814 Self::ENCODED_LEN,
4815 __tmp.remaining(),
4816 )
4817 }
4818 __tmp.put_u64_le(self.time_usec);
4819 __tmp.put_u32_le(self.active);
4820 for val in &self.actuator {
4821 __tmp.put_f32_le(*val);
4822 }
4823 if matches!(version, MavlinkVersion::V2) {
4824 let len = __tmp.len();
4825 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4826 } else {
4827 __tmp.len()
4828 }
4829 }
4830}
4831#[doc = "id: 246"]
4832#[doc = "The location and information of an ADSB vehicle."]
4833#[derive(Debug, Clone, PartialEq)]
4834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4836pub struct ADSB_VEHICLE_DATA {
4837 #[doc = "ICAO address"]
4838 pub ICAO_address: u32,
4839 #[doc = "Latitude"]
4840 pub lat: i32,
4841 #[doc = "Longitude"]
4842 pub lon: i32,
4843 #[doc = "Altitude(ASL)"]
4844 pub altitude: i32,
4845 #[doc = "Course over ground"]
4846 pub heading: u16,
4847 #[doc = "The horizontal velocity"]
4848 pub hor_velocity: u16,
4849 #[doc = "The vertical velocity. Positive is up"]
4850 pub ver_velocity: i16,
4851 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4852 pub flags: AdsbFlags,
4853 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4854 pub squawk: u16,
4855 #[doc = "ADSB altitude type."]
4856 pub altitude_type: AdsbAltitudeType,
4857 #[doc = "The callsign, 8+null"]
4858 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4859 pub callsign: [u8; 9],
4860 #[doc = "ADSB emitter type."]
4861 pub emitter_type: AdsbEmitterType,
4862 #[doc = "Time since last communication in seconds"]
4863 pub tslc: u8,
4864}
4865impl ADSB_VEHICLE_DATA {
4866 pub const ENCODED_LEN: usize = 38usize;
4867 pub const DEFAULT: Self = Self {
4868 ICAO_address: 0_u32,
4869 lat: 0_i32,
4870 lon: 0_i32,
4871 altitude: 0_i32,
4872 heading: 0_u16,
4873 hor_velocity: 0_u16,
4874 ver_velocity: 0_i16,
4875 flags: AdsbFlags::DEFAULT,
4876 squawk: 0_u16,
4877 altitude_type: AdsbAltitudeType::DEFAULT,
4878 callsign: [0_u8; 9usize],
4879 emitter_type: AdsbEmitterType::DEFAULT,
4880 tslc: 0_u8,
4881 };
4882 #[cfg(feature = "arbitrary")]
4883 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4884 use arbitrary::{Arbitrary, Unstructured};
4885 let mut buf = [0u8; 1024];
4886 rng.fill_bytes(&mut buf);
4887 let mut unstructured = Unstructured::new(&buf);
4888 Self::arbitrary(&mut unstructured).unwrap_or_default()
4889 }
4890}
4891impl Default for ADSB_VEHICLE_DATA {
4892 fn default() -> Self {
4893 Self::DEFAULT.clone()
4894 }
4895}
4896impl MessageData for ADSB_VEHICLE_DATA {
4897 type Message = MavMessage;
4898 const ID: u32 = 246u32;
4899 const NAME: &'static str = "ADSB_VEHICLE";
4900 const EXTRA_CRC: u8 = 184u8;
4901 const ENCODED_LEN: usize = 38usize;
4902 fn deser(
4903 _version: MavlinkVersion,
4904 __input: &[u8],
4905 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4906 let avail_len = __input.len();
4907 let mut payload_buf = [0; Self::ENCODED_LEN];
4908 let mut buf = if avail_len < Self::ENCODED_LEN {
4909 payload_buf[0..avail_len].copy_from_slice(__input);
4910 Bytes::new(&payload_buf)
4911 } else {
4912 Bytes::new(__input)
4913 };
4914 let mut __struct = Self::default();
4915 __struct.ICAO_address = buf.get_u32_le();
4916 __struct.lat = buf.get_i32_le();
4917 __struct.lon = buf.get_i32_le();
4918 __struct.altitude = buf.get_i32_le();
4919 __struct.heading = buf.get_u16_le();
4920 __struct.hor_velocity = buf.get_u16_le();
4921 __struct.ver_velocity = buf.get_i16_le();
4922 let tmp = buf.get_u16_le();
4923 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4924 ::mavlink_core::error::ParserError::InvalidFlag {
4925 flag_type: "AdsbFlags",
4926 value: tmp as u32,
4927 },
4928 )?;
4929 __struct.squawk = buf.get_u16_le();
4930 let tmp = buf.get_u8();
4931 __struct.altitude_type =
4932 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4933 enum_type: "AdsbAltitudeType",
4934 value: tmp as u32,
4935 })?;
4936 for v in &mut __struct.callsign {
4937 let val = buf.get_u8();
4938 *v = val;
4939 }
4940 let tmp = buf.get_u8();
4941 __struct.emitter_type =
4942 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4943 enum_type: "AdsbEmitterType",
4944 value: tmp as u32,
4945 })?;
4946 __struct.tslc = buf.get_u8();
4947 Ok(__struct)
4948 }
4949 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4950 let mut __tmp = BytesMut::new(bytes);
4951 #[allow(clippy::absurd_extreme_comparisons)]
4952 #[allow(unused_comparisons)]
4953 if __tmp.remaining() < Self::ENCODED_LEN {
4954 panic!(
4955 "buffer is too small (need {} bytes, but got {})",
4956 Self::ENCODED_LEN,
4957 __tmp.remaining(),
4958 )
4959 }
4960 __tmp.put_u32_le(self.ICAO_address);
4961 __tmp.put_i32_le(self.lat);
4962 __tmp.put_i32_le(self.lon);
4963 __tmp.put_i32_le(self.altitude);
4964 __tmp.put_u16_le(self.heading);
4965 __tmp.put_u16_le(self.hor_velocity);
4966 __tmp.put_i16_le(self.ver_velocity);
4967 __tmp.put_u16_le(self.flags.bits());
4968 __tmp.put_u16_le(self.squawk);
4969 __tmp.put_u8(self.altitude_type as u8);
4970 for val in &self.callsign {
4971 __tmp.put_u8(*val);
4972 }
4973 __tmp.put_u8(self.emitter_type as u8);
4974 __tmp.put_u8(self.tslc);
4975 if matches!(version, MavlinkVersion::V2) {
4976 let len = __tmp.len();
4977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4978 } else {
4979 __tmp.len()
4980 }
4981 }
4982}
4983#[doc = "id: 301"]
4984#[doc = "The location and information of an AIS vessel."]
4985#[derive(Debug, Clone, PartialEq)]
4986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4988pub struct AIS_VESSEL_DATA {
4989 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4990 pub MMSI: u32,
4991 #[doc = "Latitude"]
4992 pub lat: i32,
4993 #[doc = "Longitude"]
4994 pub lon: i32,
4995 #[doc = "Course over ground"]
4996 pub COG: u16,
4997 #[doc = "True heading"]
4998 pub heading: u16,
4999 #[doc = "Speed over ground"]
5000 pub velocity: u16,
5001 #[doc = "Distance from lat/lon location to bow"]
5002 pub dimension_bow: u16,
5003 #[doc = "Distance from lat/lon location to stern"]
5004 pub dimension_stern: u16,
5005 #[doc = "Time since last communication in seconds"]
5006 pub tslc: u16,
5007 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5008 pub flags: AisFlags,
5009 #[doc = "Turn rate"]
5010 pub turn_rate: i8,
5011 #[doc = "Navigational status"]
5012 pub navigational_status: AisNavStatus,
5013 #[doc = "Type of vessels"]
5014 pub mavtype: AisType,
5015 #[doc = "Distance from lat/lon location to port side"]
5016 pub dimension_port: u8,
5017 #[doc = "Distance from lat/lon location to starboard side"]
5018 pub dimension_starboard: u8,
5019 #[doc = "The vessel callsign"]
5020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5021 pub callsign: [u8; 7],
5022 #[doc = "The vessel name"]
5023 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5024 pub name: [u8; 20],
5025}
5026impl AIS_VESSEL_DATA {
5027 pub const ENCODED_LEN: usize = 58usize;
5028 pub const DEFAULT: Self = Self {
5029 MMSI: 0_u32,
5030 lat: 0_i32,
5031 lon: 0_i32,
5032 COG: 0_u16,
5033 heading: 0_u16,
5034 velocity: 0_u16,
5035 dimension_bow: 0_u16,
5036 dimension_stern: 0_u16,
5037 tslc: 0_u16,
5038 flags: AisFlags::DEFAULT,
5039 turn_rate: 0_i8,
5040 navigational_status: AisNavStatus::DEFAULT,
5041 mavtype: AisType::DEFAULT,
5042 dimension_port: 0_u8,
5043 dimension_starboard: 0_u8,
5044 callsign: [0_u8; 7usize],
5045 name: [0_u8; 20usize],
5046 };
5047 #[cfg(feature = "arbitrary")]
5048 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5049 use arbitrary::{Arbitrary, Unstructured};
5050 let mut buf = [0u8; 1024];
5051 rng.fill_bytes(&mut buf);
5052 let mut unstructured = Unstructured::new(&buf);
5053 Self::arbitrary(&mut unstructured).unwrap_or_default()
5054 }
5055}
5056impl Default for AIS_VESSEL_DATA {
5057 fn default() -> Self {
5058 Self::DEFAULT.clone()
5059 }
5060}
5061impl MessageData for AIS_VESSEL_DATA {
5062 type Message = MavMessage;
5063 const ID: u32 = 301u32;
5064 const NAME: &'static str = "AIS_VESSEL";
5065 const EXTRA_CRC: u8 = 243u8;
5066 const ENCODED_LEN: usize = 58usize;
5067 fn deser(
5068 _version: MavlinkVersion,
5069 __input: &[u8],
5070 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5071 let avail_len = __input.len();
5072 let mut payload_buf = [0; Self::ENCODED_LEN];
5073 let mut buf = if avail_len < Self::ENCODED_LEN {
5074 payload_buf[0..avail_len].copy_from_slice(__input);
5075 Bytes::new(&payload_buf)
5076 } else {
5077 Bytes::new(__input)
5078 };
5079 let mut __struct = Self::default();
5080 __struct.MMSI = buf.get_u32_le();
5081 __struct.lat = buf.get_i32_le();
5082 __struct.lon = buf.get_i32_le();
5083 __struct.COG = buf.get_u16_le();
5084 __struct.heading = buf.get_u16_le();
5085 __struct.velocity = buf.get_u16_le();
5086 __struct.dimension_bow = buf.get_u16_le();
5087 __struct.dimension_stern = buf.get_u16_le();
5088 __struct.tslc = buf.get_u16_le();
5089 let tmp = buf.get_u16_le();
5090 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
5091 ::mavlink_core::error::ParserError::InvalidFlag {
5092 flag_type: "AisFlags",
5093 value: tmp as u32,
5094 },
5095 )?;
5096 __struct.turn_rate = buf.get_i8();
5097 let tmp = buf.get_u8();
5098 __struct.navigational_status =
5099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5100 enum_type: "AisNavStatus",
5101 value: tmp as u32,
5102 })?;
5103 let tmp = buf.get_u8();
5104 __struct.mavtype =
5105 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5106 enum_type: "AisType",
5107 value: tmp as u32,
5108 })?;
5109 __struct.dimension_port = buf.get_u8();
5110 __struct.dimension_starboard = buf.get_u8();
5111 for v in &mut __struct.callsign {
5112 let val = buf.get_u8();
5113 *v = val;
5114 }
5115 for v in &mut __struct.name {
5116 let val = buf.get_u8();
5117 *v = val;
5118 }
5119 Ok(__struct)
5120 }
5121 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5122 let mut __tmp = BytesMut::new(bytes);
5123 #[allow(clippy::absurd_extreme_comparisons)]
5124 #[allow(unused_comparisons)]
5125 if __tmp.remaining() < Self::ENCODED_LEN {
5126 panic!(
5127 "buffer is too small (need {} bytes, but got {})",
5128 Self::ENCODED_LEN,
5129 __tmp.remaining(),
5130 )
5131 }
5132 __tmp.put_u32_le(self.MMSI);
5133 __tmp.put_i32_le(self.lat);
5134 __tmp.put_i32_le(self.lon);
5135 __tmp.put_u16_le(self.COG);
5136 __tmp.put_u16_le(self.heading);
5137 __tmp.put_u16_le(self.velocity);
5138 __tmp.put_u16_le(self.dimension_bow);
5139 __tmp.put_u16_le(self.dimension_stern);
5140 __tmp.put_u16_le(self.tslc);
5141 __tmp.put_u16_le(self.flags.bits());
5142 __tmp.put_i8(self.turn_rate);
5143 __tmp.put_u8(self.navigational_status as u8);
5144 __tmp.put_u8(self.mavtype as u8);
5145 __tmp.put_u8(self.dimension_port);
5146 __tmp.put_u8(self.dimension_starboard);
5147 for val in &self.callsign {
5148 __tmp.put_u8(*val);
5149 }
5150 for val in &self.name {
5151 __tmp.put_u8(*val);
5152 }
5153 if matches!(version, MavlinkVersion::V2) {
5154 let len = __tmp.len();
5155 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5156 } else {
5157 __tmp.len()
5158 }
5159 }
5160}
5161#[doc = "id: 141"]
5162#[doc = "The current system altitude."]
5163#[derive(Debug, Clone, PartialEq)]
5164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5166pub struct ALTITUDE_DATA {
5167 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5168 pub time_usec: u64,
5169 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5170 pub altitude_monotonic: f32,
5171 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5172 pub altitude_amsl: f32,
5173 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5174 pub altitude_local: f32,
5175 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5176 pub altitude_relative: f32,
5177 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5178 pub altitude_terrain: f32,
5179 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5180 pub bottom_clearance: f32,
5181}
5182impl ALTITUDE_DATA {
5183 pub const ENCODED_LEN: usize = 32usize;
5184 pub const DEFAULT: Self = Self {
5185 time_usec: 0_u64,
5186 altitude_monotonic: 0.0_f32,
5187 altitude_amsl: 0.0_f32,
5188 altitude_local: 0.0_f32,
5189 altitude_relative: 0.0_f32,
5190 altitude_terrain: 0.0_f32,
5191 bottom_clearance: 0.0_f32,
5192 };
5193 #[cfg(feature = "arbitrary")]
5194 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5195 use arbitrary::{Arbitrary, Unstructured};
5196 let mut buf = [0u8; 1024];
5197 rng.fill_bytes(&mut buf);
5198 let mut unstructured = Unstructured::new(&buf);
5199 Self::arbitrary(&mut unstructured).unwrap_or_default()
5200 }
5201}
5202impl Default for ALTITUDE_DATA {
5203 fn default() -> Self {
5204 Self::DEFAULT.clone()
5205 }
5206}
5207impl MessageData for ALTITUDE_DATA {
5208 type Message = MavMessage;
5209 const ID: u32 = 141u32;
5210 const NAME: &'static str = "ALTITUDE";
5211 const EXTRA_CRC: u8 = 47u8;
5212 const ENCODED_LEN: usize = 32usize;
5213 fn deser(
5214 _version: MavlinkVersion,
5215 __input: &[u8],
5216 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5217 let avail_len = __input.len();
5218 let mut payload_buf = [0; Self::ENCODED_LEN];
5219 let mut buf = if avail_len < Self::ENCODED_LEN {
5220 payload_buf[0..avail_len].copy_from_slice(__input);
5221 Bytes::new(&payload_buf)
5222 } else {
5223 Bytes::new(__input)
5224 };
5225 let mut __struct = Self::default();
5226 __struct.time_usec = buf.get_u64_le();
5227 __struct.altitude_monotonic = buf.get_f32_le();
5228 __struct.altitude_amsl = buf.get_f32_le();
5229 __struct.altitude_local = buf.get_f32_le();
5230 __struct.altitude_relative = buf.get_f32_le();
5231 __struct.altitude_terrain = buf.get_f32_le();
5232 __struct.bottom_clearance = buf.get_f32_le();
5233 Ok(__struct)
5234 }
5235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5236 let mut __tmp = BytesMut::new(bytes);
5237 #[allow(clippy::absurd_extreme_comparisons)]
5238 #[allow(unused_comparisons)]
5239 if __tmp.remaining() < Self::ENCODED_LEN {
5240 panic!(
5241 "buffer is too small (need {} bytes, but got {})",
5242 Self::ENCODED_LEN,
5243 __tmp.remaining(),
5244 )
5245 }
5246 __tmp.put_u64_le(self.time_usec);
5247 __tmp.put_f32_le(self.altitude_monotonic);
5248 __tmp.put_f32_le(self.altitude_amsl);
5249 __tmp.put_f32_le(self.altitude_local);
5250 __tmp.put_f32_le(self.altitude_relative);
5251 __tmp.put_f32_le(self.altitude_terrain);
5252 __tmp.put_f32_le(self.bottom_clearance);
5253 if matches!(version, MavlinkVersion::V2) {
5254 let len = __tmp.len();
5255 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5256 } else {
5257 __tmp.len()
5258 }
5259 }
5260}
5261#[doc = "id: 30"]
5262#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5263#[derive(Debug, Clone, PartialEq)]
5264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5266pub struct ATTITUDE_DATA {
5267 #[doc = "Timestamp (time since system boot)."]
5268 pub time_boot_ms: u32,
5269 #[doc = "Roll angle (-pi..+pi)"]
5270 pub roll: f32,
5271 #[doc = "Pitch angle (-pi..+pi)"]
5272 pub pitch: f32,
5273 #[doc = "Yaw angle (-pi..+pi)"]
5274 pub yaw: f32,
5275 #[doc = "Roll angular speed"]
5276 pub rollspeed: f32,
5277 #[doc = "Pitch angular speed"]
5278 pub pitchspeed: f32,
5279 #[doc = "Yaw angular speed"]
5280 pub yawspeed: f32,
5281}
5282impl ATTITUDE_DATA {
5283 pub const ENCODED_LEN: usize = 28usize;
5284 pub const DEFAULT: Self = Self {
5285 time_boot_ms: 0_u32,
5286 roll: 0.0_f32,
5287 pitch: 0.0_f32,
5288 yaw: 0.0_f32,
5289 rollspeed: 0.0_f32,
5290 pitchspeed: 0.0_f32,
5291 yawspeed: 0.0_f32,
5292 };
5293 #[cfg(feature = "arbitrary")]
5294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5295 use arbitrary::{Arbitrary, Unstructured};
5296 let mut buf = [0u8; 1024];
5297 rng.fill_bytes(&mut buf);
5298 let mut unstructured = Unstructured::new(&buf);
5299 Self::arbitrary(&mut unstructured).unwrap_or_default()
5300 }
5301}
5302impl Default for ATTITUDE_DATA {
5303 fn default() -> Self {
5304 Self::DEFAULT.clone()
5305 }
5306}
5307impl MessageData for ATTITUDE_DATA {
5308 type Message = MavMessage;
5309 const ID: u32 = 30u32;
5310 const NAME: &'static str = "ATTITUDE";
5311 const EXTRA_CRC: u8 = 39u8;
5312 const ENCODED_LEN: usize = 28usize;
5313 fn deser(
5314 _version: MavlinkVersion,
5315 __input: &[u8],
5316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5317 let avail_len = __input.len();
5318 let mut payload_buf = [0; Self::ENCODED_LEN];
5319 let mut buf = if avail_len < Self::ENCODED_LEN {
5320 payload_buf[0..avail_len].copy_from_slice(__input);
5321 Bytes::new(&payload_buf)
5322 } else {
5323 Bytes::new(__input)
5324 };
5325 let mut __struct = Self::default();
5326 __struct.time_boot_ms = buf.get_u32_le();
5327 __struct.roll = buf.get_f32_le();
5328 __struct.pitch = buf.get_f32_le();
5329 __struct.yaw = buf.get_f32_le();
5330 __struct.rollspeed = buf.get_f32_le();
5331 __struct.pitchspeed = buf.get_f32_le();
5332 __struct.yawspeed = buf.get_f32_le();
5333 Ok(__struct)
5334 }
5335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5336 let mut __tmp = BytesMut::new(bytes);
5337 #[allow(clippy::absurd_extreme_comparisons)]
5338 #[allow(unused_comparisons)]
5339 if __tmp.remaining() < Self::ENCODED_LEN {
5340 panic!(
5341 "buffer is too small (need {} bytes, but got {})",
5342 Self::ENCODED_LEN,
5343 __tmp.remaining(),
5344 )
5345 }
5346 __tmp.put_u32_le(self.time_boot_ms);
5347 __tmp.put_f32_le(self.roll);
5348 __tmp.put_f32_le(self.pitch);
5349 __tmp.put_f32_le(self.yaw);
5350 __tmp.put_f32_le(self.rollspeed);
5351 __tmp.put_f32_le(self.pitchspeed);
5352 __tmp.put_f32_le(self.yawspeed);
5353 if matches!(version, MavlinkVersion::V2) {
5354 let len = __tmp.len();
5355 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5356 } else {
5357 __tmp.len()
5358 }
5359 }
5360}
5361#[doc = "id: 31"]
5362#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5363#[derive(Debug, Clone, PartialEq)]
5364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5366pub struct ATTITUDE_QUATERNION_DATA {
5367 #[doc = "Timestamp (time since system boot)."]
5368 pub time_boot_ms: u32,
5369 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5370 pub q1: f32,
5371 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5372 pub q2: f32,
5373 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5374 pub q3: f32,
5375 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5376 pub q4: f32,
5377 #[doc = "Roll angular speed"]
5378 pub rollspeed: f32,
5379 #[doc = "Pitch angular speed"]
5380 pub pitchspeed: f32,
5381 #[doc = "Yaw angular speed"]
5382 pub yawspeed: f32,
5383 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5384 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5386 pub repr_offset_q: [f32; 4],
5387}
5388impl ATTITUDE_QUATERNION_DATA {
5389 pub const ENCODED_LEN: usize = 48usize;
5390 pub const DEFAULT: Self = Self {
5391 time_boot_ms: 0_u32,
5392 q1: 0.0_f32,
5393 q2: 0.0_f32,
5394 q3: 0.0_f32,
5395 q4: 0.0_f32,
5396 rollspeed: 0.0_f32,
5397 pitchspeed: 0.0_f32,
5398 yawspeed: 0.0_f32,
5399 repr_offset_q: [0.0_f32; 4usize],
5400 };
5401 #[cfg(feature = "arbitrary")]
5402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5403 use arbitrary::{Arbitrary, Unstructured};
5404 let mut buf = [0u8; 1024];
5405 rng.fill_bytes(&mut buf);
5406 let mut unstructured = Unstructured::new(&buf);
5407 Self::arbitrary(&mut unstructured).unwrap_or_default()
5408 }
5409}
5410impl Default for ATTITUDE_QUATERNION_DATA {
5411 fn default() -> Self {
5412 Self::DEFAULT.clone()
5413 }
5414}
5415impl MessageData for ATTITUDE_QUATERNION_DATA {
5416 type Message = MavMessage;
5417 const ID: u32 = 31u32;
5418 const NAME: &'static str = "ATTITUDE_QUATERNION";
5419 const EXTRA_CRC: u8 = 246u8;
5420 const ENCODED_LEN: usize = 48usize;
5421 fn deser(
5422 _version: MavlinkVersion,
5423 __input: &[u8],
5424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5425 let avail_len = __input.len();
5426 let mut payload_buf = [0; Self::ENCODED_LEN];
5427 let mut buf = if avail_len < Self::ENCODED_LEN {
5428 payload_buf[0..avail_len].copy_from_slice(__input);
5429 Bytes::new(&payload_buf)
5430 } else {
5431 Bytes::new(__input)
5432 };
5433 let mut __struct = Self::default();
5434 __struct.time_boot_ms = buf.get_u32_le();
5435 __struct.q1 = buf.get_f32_le();
5436 __struct.q2 = buf.get_f32_le();
5437 __struct.q3 = buf.get_f32_le();
5438 __struct.q4 = buf.get_f32_le();
5439 __struct.rollspeed = buf.get_f32_le();
5440 __struct.pitchspeed = buf.get_f32_le();
5441 __struct.yawspeed = buf.get_f32_le();
5442 for v in &mut __struct.repr_offset_q {
5443 let val = buf.get_f32_le();
5444 *v = val;
5445 }
5446 Ok(__struct)
5447 }
5448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5449 let mut __tmp = BytesMut::new(bytes);
5450 #[allow(clippy::absurd_extreme_comparisons)]
5451 #[allow(unused_comparisons)]
5452 if __tmp.remaining() < Self::ENCODED_LEN {
5453 panic!(
5454 "buffer is too small (need {} bytes, but got {})",
5455 Self::ENCODED_LEN,
5456 __tmp.remaining(),
5457 )
5458 }
5459 __tmp.put_u32_le(self.time_boot_ms);
5460 __tmp.put_f32_le(self.q1);
5461 __tmp.put_f32_le(self.q2);
5462 __tmp.put_f32_le(self.q3);
5463 __tmp.put_f32_le(self.q4);
5464 __tmp.put_f32_le(self.rollspeed);
5465 __tmp.put_f32_le(self.pitchspeed);
5466 __tmp.put_f32_le(self.yawspeed);
5467 for val in &self.repr_offset_q {
5468 __tmp.put_f32_le(*val);
5469 }
5470 if matches!(version, MavlinkVersion::V2) {
5471 let len = __tmp.len();
5472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5473 } else {
5474 __tmp.len()
5475 }
5476 }
5477}
5478#[doc = "id: 61"]
5479#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5480#[derive(Debug, Clone, PartialEq)]
5481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5483pub struct ATTITUDE_QUATERNION_COV_DATA {
5484 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5485 pub time_usec: u64,
5486 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5488 pub q: [f32; 4],
5489 #[doc = "Roll angular speed"]
5490 pub rollspeed: f32,
5491 #[doc = "Pitch angular speed"]
5492 pub pitchspeed: f32,
5493 #[doc = "Yaw angular speed"]
5494 pub yawspeed: f32,
5495 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5497 pub covariance: [f32; 9],
5498}
5499impl ATTITUDE_QUATERNION_COV_DATA {
5500 pub const ENCODED_LEN: usize = 72usize;
5501 pub const DEFAULT: Self = Self {
5502 time_usec: 0_u64,
5503 q: [0.0_f32; 4usize],
5504 rollspeed: 0.0_f32,
5505 pitchspeed: 0.0_f32,
5506 yawspeed: 0.0_f32,
5507 covariance: [0.0_f32; 9usize],
5508 };
5509 #[cfg(feature = "arbitrary")]
5510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5511 use arbitrary::{Arbitrary, Unstructured};
5512 let mut buf = [0u8; 1024];
5513 rng.fill_bytes(&mut buf);
5514 let mut unstructured = Unstructured::new(&buf);
5515 Self::arbitrary(&mut unstructured).unwrap_or_default()
5516 }
5517}
5518impl Default for ATTITUDE_QUATERNION_COV_DATA {
5519 fn default() -> Self {
5520 Self::DEFAULT.clone()
5521 }
5522}
5523impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5524 type Message = MavMessage;
5525 const ID: u32 = 61u32;
5526 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5527 const EXTRA_CRC: u8 = 167u8;
5528 const ENCODED_LEN: usize = 72usize;
5529 fn deser(
5530 _version: MavlinkVersion,
5531 __input: &[u8],
5532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5533 let avail_len = __input.len();
5534 let mut payload_buf = [0; Self::ENCODED_LEN];
5535 let mut buf = if avail_len < Self::ENCODED_LEN {
5536 payload_buf[0..avail_len].copy_from_slice(__input);
5537 Bytes::new(&payload_buf)
5538 } else {
5539 Bytes::new(__input)
5540 };
5541 let mut __struct = Self::default();
5542 __struct.time_usec = buf.get_u64_le();
5543 for v in &mut __struct.q {
5544 let val = buf.get_f32_le();
5545 *v = val;
5546 }
5547 __struct.rollspeed = buf.get_f32_le();
5548 __struct.pitchspeed = buf.get_f32_le();
5549 __struct.yawspeed = buf.get_f32_le();
5550 for v in &mut __struct.covariance {
5551 let val = buf.get_f32_le();
5552 *v = val;
5553 }
5554 Ok(__struct)
5555 }
5556 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5557 let mut __tmp = BytesMut::new(bytes);
5558 #[allow(clippy::absurd_extreme_comparisons)]
5559 #[allow(unused_comparisons)]
5560 if __tmp.remaining() < Self::ENCODED_LEN {
5561 panic!(
5562 "buffer is too small (need {} bytes, but got {})",
5563 Self::ENCODED_LEN,
5564 __tmp.remaining(),
5565 )
5566 }
5567 __tmp.put_u64_le(self.time_usec);
5568 for val in &self.q {
5569 __tmp.put_f32_le(*val);
5570 }
5571 __tmp.put_f32_le(self.rollspeed);
5572 __tmp.put_f32_le(self.pitchspeed);
5573 __tmp.put_f32_le(self.yawspeed);
5574 for val in &self.covariance {
5575 __tmp.put_f32_le(*val);
5576 }
5577 if matches!(version, MavlinkVersion::V2) {
5578 let len = __tmp.len();
5579 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5580 } else {
5581 __tmp.len()
5582 }
5583 }
5584}
5585#[doc = "id: 83"]
5586#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5587#[derive(Debug, Clone, PartialEq)]
5588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5590pub struct ATTITUDE_TARGET_DATA {
5591 #[doc = "Timestamp (time since system boot)."]
5592 pub time_boot_ms: u32,
5593 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5594 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5595 pub q: [f32; 4],
5596 #[doc = "Body roll rate"]
5597 pub body_roll_rate: f32,
5598 #[doc = "Body pitch rate"]
5599 pub body_pitch_rate: f32,
5600 #[doc = "Body yaw rate"]
5601 pub body_yaw_rate: f32,
5602 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5603 pub thrust: f32,
5604 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5605 pub type_mask: AttitudeTargetTypemask,
5606}
5607impl ATTITUDE_TARGET_DATA {
5608 pub const ENCODED_LEN: usize = 37usize;
5609 pub const DEFAULT: Self = Self {
5610 time_boot_ms: 0_u32,
5611 q: [0.0_f32; 4usize],
5612 body_roll_rate: 0.0_f32,
5613 body_pitch_rate: 0.0_f32,
5614 body_yaw_rate: 0.0_f32,
5615 thrust: 0.0_f32,
5616 type_mask: AttitudeTargetTypemask::DEFAULT,
5617 };
5618 #[cfg(feature = "arbitrary")]
5619 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5620 use arbitrary::{Arbitrary, Unstructured};
5621 let mut buf = [0u8; 1024];
5622 rng.fill_bytes(&mut buf);
5623 let mut unstructured = Unstructured::new(&buf);
5624 Self::arbitrary(&mut unstructured).unwrap_or_default()
5625 }
5626}
5627impl Default for ATTITUDE_TARGET_DATA {
5628 fn default() -> Self {
5629 Self::DEFAULT.clone()
5630 }
5631}
5632impl MessageData for ATTITUDE_TARGET_DATA {
5633 type Message = MavMessage;
5634 const ID: u32 = 83u32;
5635 const NAME: &'static str = "ATTITUDE_TARGET";
5636 const EXTRA_CRC: u8 = 22u8;
5637 const ENCODED_LEN: usize = 37usize;
5638 fn deser(
5639 _version: MavlinkVersion,
5640 __input: &[u8],
5641 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5642 let avail_len = __input.len();
5643 let mut payload_buf = [0; Self::ENCODED_LEN];
5644 let mut buf = if avail_len < Self::ENCODED_LEN {
5645 payload_buf[0..avail_len].copy_from_slice(__input);
5646 Bytes::new(&payload_buf)
5647 } else {
5648 Bytes::new(__input)
5649 };
5650 let mut __struct = Self::default();
5651 __struct.time_boot_ms = buf.get_u32_le();
5652 for v in &mut __struct.q {
5653 let val = buf.get_f32_le();
5654 *v = val;
5655 }
5656 __struct.body_roll_rate = buf.get_f32_le();
5657 __struct.body_pitch_rate = buf.get_f32_le();
5658 __struct.body_yaw_rate = buf.get_f32_le();
5659 __struct.thrust = buf.get_f32_le();
5660 let tmp = buf.get_u8();
5661 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5662 tmp & AttitudeTargetTypemask::all().bits(),
5663 )
5664 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5665 flag_type: "AttitudeTargetTypemask",
5666 value: tmp as u32,
5667 })?;
5668 Ok(__struct)
5669 }
5670 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5671 let mut __tmp = BytesMut::new(bytes);
5672 #[allow(clippy::absurd_extreme_comparisons)]
5673 #[allow(unused_comparisons)]
5674 if __tmp.remaining() < Self::ENCODED_LEN {
5675 panic!(
5676 "buffer is too small (need {} bytes, but got {})",
5677 Self::ENCODED_LEN,
5678 __tmp.remaining(),
5679 )
5680 }
5681 __tmp.put_u32_le(self.time_boot_ms);
5682 for val in &self.q {
5683 __tmp.put_f32_le(*val);
5684 }
5685 __tmp.put_f32_le(self.body_roll_rate);
5686 __tmp.put_f32_le(self.body_pitch_rate);
5687 __tmp.put_f32_le(self.body_yaw_rate);
5688 __tmp.put_f32_le(self.thrust);
5689 __tmp.put_u8(self.type_mask.bits());
5690 if matches!(version, MavlinkVersion::V2) {
5691 let len = __tmp.len();
5692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5693 } else {
5694 __tmp.len()
5695 }
5696 }
5697}
5698#[doc = "id: 138"]
5699#[doc = "Motion capture attitude and position."]
5700#[derive(Debug, Clone, PartialEq)]
5701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5703pub struct ATT_POS_MOCAP_DATA {
5704 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5705 pub time_usec: u64,
5706 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5708 pub q: [f32; 4],
5709 #[doc = "X position (NED)"]
5710 pub x: f32,
5711 #[doc = "Y position (NED)"]
5712 pub y: f32,
5713 #[doc = "Z position (NED)"]
5714 pub z: f32,
5715 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5717 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5718 pub covariance: [f32; 21],
5719}
5720impl ATT_POS_MOCAP_DATA {
5721 pub const ENCODED_LEN: usize = 120usize;
5722 pub const DEFAULT: Self = Self {
5723 time_usec: 0_u64,
5724 q: [0.0_f32; 4usize],
5725 x: 0.0_f32,
5726 y: 0.0_f32,
5727 z: 0.0_f32,
5728 covariance: [0.0_f32; 21usize],
5729 };
5730 #[cfg(feature = "arbitrary")]
5731 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5732 use arbitrary::{Arbitrary, Unstructured};
5733 let mut buf = [0u8; 1024];
5734 rng.fill_bytes(&mut buf);
5735 let mut unstructured = Unstructured::new(&buf);
5736 Self::arbitrary(&mut unstructured).unwrap_or_default()
5737 }
5738}
5739impl Default for ATT_POS_MOCAP_DATA {
5740 fn default() -> Self {
5741 Self::DEFAULT.clone()
5742 }
5743}
5744impl MessageData for ATT_POS_MOCAP_DATA {
5745 type Message = MavMessage;
5746 const ID: u32 = 138u32;
5747 const NAME: &'static str = "ATT_POS_MOCAP";
5748 const EXTRA_CRC: u8 = 109u8;
5749 const ENCODED_LEN: usize = 120usize;
5750 fn deser(
5751 _version: MavlinkVersion,
5752 __input: &[u8],
5753 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5754 let avail_len = __input.len();
5755 let mut payload_buf = [0; Self::ENCODED_LEN];
5756 let mut buf = if avail_len < Self::ENCODED_LEN {
5757 payload_buf[0..avail_len].copy_from_slice(__input);
5758 Bytes::new(&payload_buf)
5759 } else {
5760 Bytes::new(__input)
5761 };
5762 let mut __struct = Self::default();
5763 __struct.time_usec = buf.get_u64_le();
5764 for v in &mut __struct.q {
5765 let val = buf.get_f32_le();
5766 *v = val;
5767 }
5768 __struct.x = buf.get_f32_le();
5769 __struct.y = buf.get_f32_le();
5770 __struct.z = buf.get_f32_le();
5771 for v in &mut __struct.covariance {
5772 let val = buf.get_f32_le();
5773 *v = val;
5774 }
5775 Ok(__struct)
5776 }
5777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5778 let mut __tmp = BytesMut::new(bytes);
5779 #[allow(clippy::absurd_extreme_comparisons)]
5780 #[allow(unused_comparisons)]
5781 if __tmp.remaining() < Self::ENCODED_LEN {
5782 panic!(
5783 "buffer is too small (need {} bytes, but got {})",
5784 Self::ENCODED_LEN,
5785 __tmp.remaining(),
5786 )
5787 }
5788 __tmp.put_u64_le(self.time_usec);
5789 for val in &self.q {
5790 __tmp.put_f32_le(*val);
5791 }
5792 __tmp.put_f32_le(self.x);
5793 __tmp.put_f32_le(self.y);
5794 __tmp.put_f32_le(self.z);
5795 for val in &self.covariance {
5796 __tmp.put_f32_le(*val);
5797 }
5798 if matches!(version, MavlinkVersion::V2) {
5799 let len = __tmp.len();
5800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5801 } else {
5802 __tmp.len()
5803 }
5804 }
5805}
5806#[doc = "id: 7"]
5807#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5808#[derive(Debug, Clone, PartialEq)]
5809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5811pub struct AUTH_KEY_DATA {
5812 #[doc = "key"]
5813 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5814 pub key: [u8; 32],
5815}
5816impl AUTH_KEY_DATA {
5817 pub const ENCODED_LEN: usize = 32usize;
5818 pub const DEFAULT: Self = Self {
5819 key: [0_u8; 32usize],
5820 };
5821 #[cfg(feature = "arbitrary")]
5822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5823 use arbitrary::{Arbitrary, Unstructured};
5824 let mut buf = [0u8; 1024];
5825 rng.fill_bytes(&mut buf);
5826 let mut unstructured = Unstructured::new(&buf);
5827 Self::arbitrary(&mut unstructured).unwrap_or_default()
5828 }
5829}
5830impl Default for AUTH_KEY_DATA {
5831 fn default() -> Self {
5832 Self::DEFAULT.clone()
5833 }
5834}
5835impl MessageData for AUTH_KEY_DATA {
5836 type Message = MavMessage;
5837 const ID: u32 = 7u32;
5838 const NAME: &'static str = "AUTH_KEY";
5839 const EXTRA_CRC: u8 = 119u8;
5840 const ENCODED_LEN: usize = 32usize;
5841 fn deser(
5842 _version: MavlinkVersion,
5843 __input: &[u8],
5844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5845 let avail_len = __input.len();
5846 let mut payload_buf = [0; Self::ENCODED_LEN];
5847 let mut buf = if avail_len < Self::ENCODED_LEN {
5848 payload_buf[0..avail_len].copy_from_slice(__input);
5849 Bytes::new(&payload_buf)
5850 } else {
5851 Bytes::new(__input)
5852 };
5853 let mut __struct = Self::default();
5854 for v in &mut __struct.key {
5855 let val = buf.get_u8();
5856 *v = val;
5857 }
5858 Ok(__struct)
5859 }
5860 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5861 let mut __tmp = BytesMut::new(bytes);
5862 #[allow(clippy::absurd_extreme_comparisons)]
5863 #[allow(unused_comparisons)]
5864 if __tmp.remaining() < Self::ENCODED_LEN {
5865 panic!(
5866 "buffer is too small (need {} bytes, but got {})",
5867 Self::ENCODED_LEN,
5868 __tmp.remaining(),
5869 )
5870 }
5871 for val in &self.key {
5872 __tmp.put_u8(*val);
5873 }
5874 if matches!(version, MavlinkVersion::V2) {
5875 let len = __tmp.len();
5876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5877 } else {
5878 __tmp.len()
5879 }
5880 }
5881}
5882#[doc = "id: 286"]
5883#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5884#[derive(Debug, Clone, PartialEq)]
5885#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5886#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5887pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5888 #[doc = "Timestamp (time since system boot)."]
5889 pub time_boot_us: u64,
5890 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5891 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5892 pub q: [f32; 4],
5893 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5894 pub q_estimated_delay_us: u32,
5895 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5896 pub vx: f32,
5897 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5898 pub vy: f32,
5899 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5900 pub vz: f32,
5901 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5902 pub v_estimated_delay_us: u32,
5903 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5904 pub feed_forward_angular_velocity_z: f32,
5905 #[doc = "Bitmap indicating which estimator outputs are valid."]
5906 pub estimator_status: EstimatorStatusFlags,
5907 #[doc = "System ID"]
5908 pub target_system: u8,
5909 #[doc = "Component ID"]
5910 pub target_component: u8,
5911 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5912 pub landed_state: MavLandedState,
5913 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5914 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5915 pub angular_velocity_z: f32,
5916}
5917impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5918 pub const ENCODED_LEN: usize = 57usize;
5919 pub const DEFAULT: Self = Self {
5920 time_boot_us: 0_u64,
5921 q: [0.0_f32; 4usize],
5922 q_estimated_delay_us: 0_u32,
5923 vx: 0.0_f32,
5924 vy: 0.0_f32,
5925 vz: 0.0_f32,
5926 v_estimated_delay_us: 0_u32,
5927 feed_forward_angular_velocity_z: 0.0_f32,
5928 estimator_status: EstimatorStatusFlags::DEFAULT,
5929 target_system: 0_u8,
5930 target_component: 0_u8,
5931 landed_state: MavLandedState::DEFAULT,
5932 angular_velocity_z: 0.0_f32,
5933 };
5934 #[cfg(feature = "arbitrary")]
5935 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5936 use arbitrary::{Arbitrary, Unstructured};
5937 let mut buf = [0u8; 1024];
5938 rng.fill_bytes(&mut buf);
5939 let mut unstructured = Unstructured::new(&buf);
5940 Self::arbitrary(&mut unstructured).unwrap_or_default()
5941 }
5942}
5943impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5944 fn default() -> Self {
5945 Self::DEFAULT.clone()
5946 }
5947}
5948impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5949 type Message = MavMessage;
5950 const ID: u32 = 286u32;
5951 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5952 const EXTRA_CRC: u8 = 210u8;
5953 const ENCODED_LEN: usize = 57usize;
5954 fn deser(
5955 _version: MavlinkVersion,
5956 __input: &[u8],
5957 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5958 let avail_len = __input.len();
5959 let mut payload_buf = [0; Self::ENCODED_LEN];
5960 let mut buf = if avail_len < Self::ENCODED_LEN {
5961 payload_buf[0..avail_len].copy_from_slice(__input);
5962 Bytes::new(&payload_buf)
5963 } else {
5964 Bytes::new(__input)
5965 };
5966 let mut __struct = Self::default();
5967 __struct.time_boot_us = buf.get_u64_le();
5968 for v in &mut __struct.q {
5969 let val = buf.get_f32_le();
5970 *v = val;
5971 }
5972 __struct.q_estimated_delay_us = buf.get_u32_le();
5973 __struct.vx = buf.get_f32_le();
5974 __struct.vy = buf.get_f32_le();
5975 __struct.vz = buf.get_f32_le();
5976 __struct.v_estimated_delay_us = buf.get_u32_le();
5977 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5978 let tmp = buf.get_u16_le();
5979 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5980 tmp & EstimatorStatusFlags::all().bits(),
5981 )
5982 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5983 flag_type: "EstimatorStatusFlags",
5984 value: tmp as u32,
5985 })?;
5986 __struct.target_system = buf.get_u8();
5987 __struct.target_component = buf.get_u8();
5988 let tmp = buf.get_u8();
5989 __struct.landed_state =
5990 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5991 enum_type: "MavLandedState",
5992 value: tmp as u32,
5993 })?;
5994 __struct.angular_velocity_z = buf.get_f32_le();
5995 Ok(__struct)
5996 }
5997 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5998 let mut __tmp = BytesMut::new(bytes);
5999 #[allow(clippy::absurd_extreme_comparisons)]
6000 #[allow(unused_comparisons)]
6001 if __tmp.remaining() < Self::ENCODED_LEN {
6002 panic!(
6003 "buffer is too small (need {} bytes, but got {})",
6004 Self::ENCODED_LEN,
6005 __tmp.remaining(),
6006 )
6007 }
6008 __tmp.put_u64_le(self.time_boot_us);
6009 for val in &self.q {
6010 __tmp.put_f32_le(*val);
6011 }
6012 __tmp.put_u32_le(self.q_estimated_delay_us);
6013 __tmp.put_f32_le(self.vx);
6014 __tmp.put_f32_le(self.vy);
6015 __tmp.put_f32_le(self.vz);
6016 __tmp.put_u32_le(self.v_estimated_delay_us);
6017 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
6018 __tmp.put_u16_le(self.estimator_status.bits());
6019 __tmp.put_u8(self.target_system);
6020 __tmp.put_u8(self.target_component);
6021 __tmp.put_u8(self.landed_state as u8);
6022 __tmp.put_f32_le(self.angular_velocity_z);
6023 if matches!(version, MavlinkVersion::V2) {
6024 let len = __tmp.len();
6025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6026 } else {
6027 __tmp.len()
6028 }
6029 }
6030}
6031#[doc = "id: 148"]
6032#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
6033#[derive(Debug, Clone, PartialEq)]
6034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6036pub struct AUTOPILOT_VERSION_DATA {
6037 #[doc = "Bitmap of capabilities"]
6038 pub capabilities: MavProtocolCapability,
6039 #[doc = "UID if provided by hardware (see uid2)"]
6040 pub uid: u64,
6041 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
6042 pub flight_sw_version: u32,
6043 #[doc = "Middleware version number"]
6044 pub middleware_sw_version: u32,
6045 #[doc = "Operating system version number"]
6046 pub os_sw_version: u32,
6047 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
6048 pub board_version: u32,
6049 #[doc = "ID of the board vendor"]
6050 pub vendor_id: u16,
6051 #[doc = "ID of the product"]
6052 pub product_id: u16,
6053 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6055 pub flight_custom_version: [u8; 8],
6056 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6057 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6058 pub middleware_custom_version: [u8; 8],
6059 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
6060 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6061 pub os_custom_version: [u8; 8],
6062 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
6063 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6064 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6065 pub uid2: [u8; 18],
6066}
6067impl AUTOPILOT_VERSION_DATA {
6068 pub const ENCODED_LEN: usize = 78usize;
6069 pub const DEFAULT: Self = Self {
6070 capabilities: MavProtocolCapability::DEFAULT,
6071 uid: 0_u64,
6072 flight_sw_version: 0_u32,
6073 middleware_sw_version: 0_u32,
6074 os_sw_version: 0_u32,
6075 board_version: 0_u32,
6076 vendor_id: 0_u16,
6077 product_id: 0_u16,
6078 flight_custom_version: [0_u8; 8usize],
6079 middleware_custom_version: [0_u8; 8usize],
6080 os_custom_version: [0_u8; 8usize],
6081 uid2: [0_u8; 18usize],
6082 };
6083 #[cfg(feature = "arbitrary")]
6084 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6085 use arbitrary::{Arbitrary, Unstructured};
6086 let mut buf = [0u8; 1024];
6087 rng.fill_bytes(&mut buf);
6088 let mut unstructured = Unstructured::new(&buf);
6089 Self::arbitrary(&mut unstructured).unwrap_or_default()
6090 }
6091}
6092impl Default for AUTOPILOT_VERSION_DATA {
6093 fn default() -> Self {
6094 Self::DEFAULT.clone()
6095 }
6096}
6097impl MessageData for AUTOPILOT_VERSION_DATA {
6098 type Message = MavMessage;
6099 const ID: u32 = 148u32;
6100 const NAME: &'static str = "AUTOPILOT_VERSION";
6101 const EXTRA_CRC: u8 = 178u8;
6102 const ENCODED_LEN: usize = 78usize;
6103 fn deser(
6104 _version: MavlinkVersion,
6105 __input: &[u8],
6106 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6107 let avail_len = __input.len();
6108 let mut payload_buf = [0; Self::ENCODED_LEN];
6109 let mut buf = if avail_len < Self::ENCODED_LEN {
6110 payload_buf[0..avail_len].copy_from_slice(__input);
6111 Bytes::new(&payload_buf)
6112 } else {
6113 Bytes::new(__input)
6114 };
6115 let mut __struct = Self::default();
6116 let tmp = buf.get_u64_le();
6117 __struct.capabilities = MavProtocolCapability::from_bits(
6118 tmp & MavProtocolCapability::all().bits(),
6119 )
6120 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6121 flag_type: "MavProtocolCapability",
6122 value: tmp as u32,
6123 })?;
6124 __struct.uid = buf.get_u64_le();
6125 __struct.flight_sw_version = buf.get_u32_le();
6126 __struct.middleware_sw_version = buf.get_u32_le();
6127 __struct.os_sw_version = buf.get_u32_le();
6128 __struct.board_version = buf.get_u32_le();
6129 __struct.vendor_id = buf.get_u16_le();
6130 __struct.product_id = buf.get_u16_le();
6131 for v in &mut __struct.flight_custom_version {
6132 let val = buf.get_u8();
6133 *v = val;
6134 }
6135 for v in &mut __struct.middleware_custom_version {
6136 let val = buf.get_u8();
6137 *v = val;
6138 }
6139 for v in &mut __struct.os_custom_version {
6140 let val = buf.get_u8();
6141 *v = val;
6142 }
6143 for v in &mut __struct.uid2 {
6144 let val = buf.get_u8();
6145 *v = val;
6146 }
6147 Ok(__struct)
6148 }
6149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6150 let mut __tmp = BytesMut::new(bytes);
6151 #[allow(clippy::absurd_extreme_comparisons)]
6152 #[allow(unused_comparisons)]
6153 if __tmp.remaining() < Self::ENCODED_LEN {
6154 panic!(
6155 "buffer is too small (need {} bytes, but got {})",
6156 Self::ENCODED_LEN,
6157 __tmp.remaining(),
6158 )
6159 }
6160 __tmp.put_u64_le(self.capabilities.bits());
6161 __tmp.put_u64_le(self.uid);
6162 __tmp.put_u32_le(self.flight_sw_version);
6163 __tmp.put_u32_le(self.middleware_sw_version);
6164 __tmp.put_u32_le(self.os_sw_version);
6165 __tmp.put_u32_le(self.board_version);
6166 __tmp.put_u16_le(self.vendor_id);
6167 __tmp.put_u16_le(self.product_id);
6168 for val in &self.flight_custom_version {
6169 __tmp.put_u8(*val);
6170 }
6171 for val in &self.middleware_custom_version {
6172 __tmp.put_u8(*val);
6173 }
6174 for val in &self.os_custom_version {
6175 __tmp.put_u8(*val);
6176 }
6177 for val in &self.uid2 {
6178 __tmp.put_u8(*val);
6179 }
6180 if matches!(version, MavlinkVersion::V2) {
6181 let len = __tmp.len();
6182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6183 } else {
6184 __tmp.len()
6185 }
6186 }
6187}
6188#[doc = "id: 435"]
6189#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6190#[derive(Debug, Clone, PartialEq)]
6191#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6192#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6193pub struct AVAILABLE_MODES_DATA {
6194 #[doc = "A bitfield for use for autopilot-specific flags"]
6195 pub custom_mode: u32,
6196 #[doc = "Mode properties."]
6197 pub properties: MavModeProperty,
6198 #[doc = "The total number of available modes for the current vehicle type."]
6199 pub number_modes: u8,
6200 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6201 pub mode_index: u8,
6202 #[doc = "Standard mode."]
6203 pub standard_mode: MavStandardMode,
6204 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6205 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6206 pub mode_name: [u8; 35],
6207}
6208impl AVAILABLE_MODES_DATA {
6209 pub const ENCODED_LEN: usize = 46usize;
6210 pub const DEFAULT: Self = Self {
6211 custom_mode: 0_u32,
6212 properties: MavModeProperty::DEFAULT,
6213 number_modes: 0_u8,
6214 mode_index: 0_u8,
6215 standard_mode: MavStandardMode::DEFAULT,
6216 mode_name: [0_u8; 35usize],
6217 };
6218 #[cfg(feature = "arbitrary")]
6219 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6220 use arbitrary::{Arbitrary, Unstructured};
6221 let mut buf = [0u8; 1024];
6222 rng.fill_bytes(&mut buf);
6223 let mut unstructured = Unstructured::new(&buf);
6224 Self::arbitrary(&mut unstructured).unwrap_or_default()
6225 }
6226}
6227impl Default for AVAILABLE_MODES_DATA {
6228 fn default() -> Self {
6229 Self::DEFAULT.clone()
6230 }
6231}
6232impl MessageData for AVAILABLE_MODES_DATA {
6233 type Message = MavMessage;
6234 const ID: u32 = 435u32;
6235 const NAME: &'static str = "AVAILABLE_MODES";
6236 const EXTRA_CRC: u8 = 134u8;
6237 const ENCODED_LEN: usize = 46usize;
6238 fn deser(
6239 _version: MavlinkVersion,
6240 __input: &[u8],
6241 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6242 let avail_len = __input.len();
6243 let mut payload_buf = [0; Self::ENCODED_LEN];
6244 let mut buf = if avail_len < Self::ENCODED_LEN {
6245 payload_buf[0..avail_len].copy_from_slice(__input);
6246 Bytes::new(&payload_buf)
6247 } else {
6248 Bytes::new(__input)
6249 };
6250 let mut __struct = Self::default();
6251 __struct.custom_mode = buf.get_u32_le();
6252 let tmp = buf.get_u32_le();
6253 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6254 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6255 flag_type: "MavModeProperty",
6256 value: tmp as u32,
6257 })?;
6258 __struct.number_modes = buf.get_u8();
6259 __struct.mode_index = buf.get_u8();
6260 let tmp = buf.get_u8();
6261 __struct.standard_mode =
6262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6263 enum_type: "MavStandardMode",
6264 value: tmp as u32,
6265 })?;
6266 for v in &mut __struct.mode_name {
6267 let val = buf.get_u8();
6268 *v = val;
6269 }
6270 Ok(__struct)
6271 }
6272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6273 let mut __tmp = BytesMut::new(bytes);
6274 #[allow(clippy::absurd_extreme_comparisons)]
6275 #[allow(unused_comparisons)]
6276 if __tmp.remaining() < Self::ENCODED_LEN {
6277 panic!(
6278 "buffer is too small (need {} bytes, but got {})",
6279 Self::ENCODED_LEN,
6280 __tmp.remaining(),
6281 )
6282 }
6283 __tmp.put_u32_le(self.custom_mode);
6284 __tmp.put_u32_le(self.properties.bits());
6285 __tmp.put_u8(self.number_modes);
6286 __tmp.put_u8(self.mode_index);
6287 __tmp.put_u8(self.standard_mode as u8);
6288 for val in &self.mode_name {
6289 __tmp.put_u8(*val);
6290 }
6291 if matches!(version, MavlinkVersion::V2) {
6292 let len = __tmp.len();
6293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6294 } else {
6295 __tmp.len()
6296 }
6297 }
6298}
6299#[doc = "id: 437"]
6300#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6301#[derive(Debug, Clone, PartialEq)]
6302#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6303#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6304pub struct AVAILABLE_MODES_MONITOR_DATA {
6305 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6306 pub seq: u8,
6307}
6308impl AVAILABLE_MODES_MONITOR_DATA {
6309 pub const ENCODED_LEN: usize = 1usize;
6310 pub const DEFAULT: Self = Self { seq: 0_u8 };
6311 #[cfg(feature = "arbitrary")]
6312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6313 use arbitrary::{Arbitrary, Unstructured};
6314 let mut buf = [0u8; 1024];
6315 rng.fill_bytes(&mut buf);
6316 let mut unstructured = Unstructured::new(&buf);
6317 Self::arbitrary(&mut unstructured).unwrap_or_default()
6318 }
6319}
6320impl Default for AVAILABLE_MODES_MONITOR_DATA {
6321 fn default() -> Self {
6322 Self::DEFAULT.clone()
6323 }
6324}
6325impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6326 type Message = MavMessage;
6327 const ID: u32 = 437u32;
6328 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6329 const EXTRA_CRC: u8 = 30u8;
6330 const ENCODED_LEN: usize = 1usize;
6331 fn deser(
6332 _version: MavlinkVersion,
6333 __input: &[u8],
6334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6335 let avail_len = __input.len();
6336 let mut payload_buf = [0; Self::ENCODED_LEN];
6337 let mut buf = if avail_len < Self::ENCODED_LEN {
6338 payload_buf[0..avail_len].copy_from_slice(__input);
6339 Bytes::new(&payload_buf)
6340 } else {
6341 Bytes::new(__input)
6342 };
6343 let mut __struct = Self::default();
6344 __struct.seq = buf.get_u8();
6345 Ok(__struct)
6346 }
6347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6348 let mut __tmp = BytesMut::new(bytes);
6349 #[allow(clippy::absurd_extreme_comparisons)]
6350 #[allow(unused_comparisons)]
6351 if __tmp.remaining() < Self::ENCODED_LEN {
6352 panic!(
6353 "buffer is too small (need {} bytes, but got {})",
6354 Self::ENCODED_LEN,
6355 __tmp.remaining(),
6356 )
6357 }
6358 __tmp.put_u8(self.seq);
6359 if matches!(version, MavlinkVersion::V2) {
6360 let len = __tmp.len();
6361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6362 } else {
6363 __tmp.len()
6364 }
6365 }
6366}
6367#[doc = "id: 372"]
6368#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6369#[derive(Debug, Clone, PartialEq)]
6370#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6371#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6372pub struct BATTERY_INFO_DATA {
6373 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6374 pub discharge_minimum_voltage: f32,
6375 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6376 pub charging_minimum_voltage: f32,
6377 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6378 pub resting_minimum_voltage: f32,
6379 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6380 pub charging_maximum_voltage: f32,
6381 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6382 pub charging_maximum_current: f32,
6383 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6384 pub nominal_voltage: f32,
6385 #[doc = "Maximum pack discharge current. 0: field not provided."]
6386 pub discharge_maximum_current: f32,
6387 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6388 pub discharge_maximum_burst_current: f32,
6389 #[doc = "Fully charged design capacity. 0: field not provided."]
6390 pub design_capacity: f32,
6391 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6392 pub full_charge_capacity: f32,
6393 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6394 pub cycle_count: u16,
6395 #[doc = "Battery weight. 0: field not provided."]
6396 pub weight: u16,
6397 #[doc = "Battery ID"]
6398 pub id: u8,
6399 #[doc = "Function of the battery."]
6400 pub battery_function: MavBatteryFunction,
6401 #[doc = "Type (chemistry) of the battery."]
6402 pub mavtype: MavBatteryType,
6403 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6404 pub state_of_health: u8,
6405 #[doc = "Number of battery cells in series. 0: field not provided."]
6406 pub cells_in_series: u8,
6407 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6408 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6409 pub manufacture_date: [u8; 9],
6410 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6411 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6412 pub serial_number: [u8; 32],
6413 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6414 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6415 pub name: [u8; 50],
6416}
6417impl BATTERY_INFO_DATA {
6418 pub const ENCODED_LEN: usize = 140usize;
6419 pub const DEFAULT: Self = Self {
6420 discharge_minimum_voltage: 0.0_f32,
6421 charging_minimum_voltage: 0.0_f32,
6422 resting_minimum_voltage: 0.0_f32,
6423 charging_maximum_voltage: 0.0_f32,
6424 charging_maximum_current: 0.0_f32,
6425 nominal_voltage: 0.0_f32,
6426 discharge_maximum_current: 0.0_f32,
6427 discharge_maximum_burst_current: 0.0_f32,
6428 design_capacity: 0.0_f32,
6429 full_charge_capacity: 0.0_f32,
6430 cycle_count: 0_u16,
6431 weight: 0_u16,
6432 id: 0_u8,
6433 battery_function: MavBatteryFunction::DEFAULT,
6434 mavtype: MavBatteryType::DEFAULT,
6435 state_of_health: 0_u8,
6436 cells_in_series: 0_u8,
6437 manufacture_date: [0_u8; 9usize],
6438 serial_number: [0_u8; 32usize],
6439 name: [0_u8; 50usize],
6440 };
6441 #[cfg(feature = "arbitrary")]
6442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6443 use arbitrary::{Arbitrary, Unstructured};
6444 let mut buf = [0u8; 1024];
6445 rng.fill_bytes(&mut buf);
6446 let mut unstructured = Unstructured::new(&buf);
6447 Self::arbitrary(&mut unstructured).unwrap_or_default()
6448 }
6449}
6450impl Default for BATTERY_INFO_DATA {
6451 fn default() -> Self {
6452 Self::DEFAULT.clone()
6453 }
6454}
6455impl MessageData for BATTERY_INFO_DATA {
6456 type Message = MavMessage;
6457 const ID: u32 = 372u32;
6458 const NAME: &'static str = "BATTERY_INFO";
6459 const EXTRA_CRC: u8 = 26u8;
6460 const ENCODED_LEN: usize = 140usize;
6461 fn deser(
6462 _version: MavlinkVersion,
6463 __input: &[u8],
6464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6465 let avail_len = __input.len();
6466 let mut payload_buf = [0; Self::ENCODED_LEN];
6467 let mut buf = if avail_len < Self::ENCODED_LEN {
6468 payload_buf[0..avail_len].copy_from_slice(__input);
6469 Bytes::new(&payload_buf)
6470 } else {
6471 Bytes::new(__input)
6472 };
6473 let mut __struct = Self::default();
6474 __struct.discharge_minimum_voltage = buf.get_f32_le();
6475 __struct.charging_minimum_voltage = buf.get_f32_le();
6476 __struct.resting_minimum_voltage = buf.get_f32_le();
6477 __struct.charging_maximum_voltage = buf.get_f32_le();
6478 __struct.charging_maximum_current = buf.get_f32_le();
6479 __struct.nominal_voltage = buf.get_f32_le();
6480 __struct.discharge_maximum_current = buf.get_f32_le();
6481 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6482 __struct.design_capacity = buf.get_f32_le();
6483 __struct.full_charge_capacity = buf.get_f32_le();
6484 __struct.cycle_count = buf.get_u16_le();
6485 __struct.weight = buf.get_u16_le();
6486 __struct.id = buf.get_u8();
6487 let tmp = buf.get_u8();
6488 __struct.battery_function =
6489 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6490 enum_type: "MavBatteryFunction",
6491 value: tmp as u32,
6492 })?;
6493 let tmp = buf.get_u8();
6494 __struct.mavtype =
6495 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6496 enum_type: "MavBatteryType",
6497 value: tmp as u32,
6498 })?;
6499 __struct.state_of_health = buf.get_u8();
6500 __struct.cells_in_series = buf.get_u8();
6501 for v in &mut __struct.manufacture_date {
6502 let val = buf.get_u8();
6503 *v = val;
6504 }
6505 for v in &mut __struct.serial_number {
6506 let val = buf.get_u8();
6507 *v = val;
6508 }
6509 for v in &mut __struct.name {
6510 let val = buf.get_u8();
6511 *v = val;
6512 }
6513 Ok(__struct)
6514 }
6515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6516 let mut __tmp = BytesMut::new(bytes);
6517 #[allow(clippy::absurd_extreme_comparisons)]
6518 #[allow(unused_comparisons)]
6519 if __tmp.remaining() < Self::ENCODED_LEN {
6520 panic!(
6521 "buffer is too small (need {} bytes, but got {})",
6522 Self::ENCODED_LEN,
6523 __tmp.remaining(),
6524 )
6525 }
6526 __tmp.put_f32_le(self.discharge_minimum_voltage);
6527 __tmp.put_f32_le(self.charging_minimum_voltage);
6528 __tmp.put_f32_le(self.resting_minimum_voltage);
6529 __tmp.put_f32_le(self.charging_maximum_voltage);
6530 __tmp.put_f32_le(self.charging_maximum_current);
6531 __tmp.put_f32_le(self.nominal_voltage);
6532 __tmp.put_f32_le(self.discharge_maximum_current);
6533 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6534 __tmp.put_f32_le(self.design_capacity);
6535 __tmp.put_f32_le(self.full_charge_capacity);
6536 __tmp.put_u16_le(self.cycle_count);
6537 __tmp.put_u16_le(self.weight);
6538 __tmp.put_u8(self.id);
6539 __tmp.put_u8(self.battery_function as u8);
6540 __tmp.put_u8(self.mavtype as u8);
6541 __tmp.put_u8(self.state_of_health);
6542 __tmp.put_u8(self.cells_in_series);
6543 for val in &self.manufacture_date {
6544 __tmp.put_u8(*val);
6545 }
6546 for val in &self.serial_number {
6547 __tmp.put_u8(*val);
6548 }
6549 for val in &self.name {
6550 __tmp.put_u8(*val);
6551 }
6552 if matches!(version, MavlinkVersion::V2) {
6553 let len = __tmp.len();
6554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6555 } else {
6556 __tmp.len()
6557 }
6558 }
6559}
6560#[doc = "id: 147"]
6561#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6562#[derive(Debug, Clone, PartialEq)]
6563#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6564#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6565pub struct BATTERY_STATUS_DATA {
6566 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6567 pub current_consumed: i32,
6568 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6569 pub energy_consumed: i32,
6570 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6571 pub temperature: i16,
6572 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6573 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6574 pub voltages: [u16; 10],
6575 #[doc = "Battery current, -1: autopilot does not measure the current"]
6576 pub current_battery: i16,
6577 #[doc = "Battery ID"]
6578 pub id: u8,
6579 #[doc = "Function of the battery"]
6580 pub battery_function: MavBatteryFunction,
6581 #[doc = "Type (chemistry) of the battery"]
6582 pub mavtype: MavBatteryType,
6583 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6584 pub battery_remaining: i8,
6585 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6586 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6587 pub time_remaining: i32,
6588 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6589 #[cfg_attr(feature = "serde", serde(default))]
6590 pub charge_state: MavBatteryChargeState,
6591 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6592 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6593 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6594 pub voltages_ext: [u16; 4],
6595 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6596 #[cfg_attr(feature = "serde", serde(default))]
6597 pub mode: MavBatteryMode,
6598 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6599 #[cfg_attr(feature = "serde", serde(default))]
6600 pub fault_bitmask: MavBatteryFault,
6601}
6602impl BATTERY_STATUS_DATA {
6603 pub const ENCODED_LEN: usize = 54usize;
6604 pub const DEFAULT: Self = Self {
6605 current_consumed: 0_i32,
6606 energy_consumed: 0_i32,
6607 temperature: 0_i16,
6608 voltages: [0_u16; 10usize],
6609 current_battery: 0_i16,
6610 id: 0_u8,
6611 battery_function: MavBatteryFunction::DEFAULT,
6612 mavtype: MavBatteryType::DEFAULT,
6613 battery_remaining: 0_i8,
6614 time_remaining: 0_i32,
6615 charge_state: MavBatteryChargeState::DEFAULT,
6616 voltages_ext: [0_u16; 4usize],
6617 mode: MavBatteryMode::DEFAULT,
6618 fault_bitmask: MavBatteryFault::DEFAULT,
6619 };
6620 #[cfg(feature = "arbitrary")]
6621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6622 use arbitrary::{Arbitrary, Unstructured};
6623 let mut buf = [0u8; 1024];
6624 rng.fill_bytes(&mut buf);
6625 let mut unstructured = Unstructured::new(&buf);
6626 Self::arbitrary(&mut unstructured).unwrap_or_default()
6627 }
6628}
6629impl Default for BATTERY_STATUS_DATA {
6630 fn default() -> Self {
6631 Self::DEFAULT.clone()
6632 }
6633}
6634impl MessageData for BATTERY_STATUS_DATA {
6635 type Message = MavMessage;
6636 const ID: u32 = 147u32;
6637 const NAME: &'static str = "BATTERY_STATUS";
6638 const EXTRA_CRC: u8 = 154u8;
6639 const ENCODED_LEN: usize = 54usize;
6640 fn deser(
6641 _version: MavlinkVersion,
6642 __input: &[u8],
6643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6644 let avail_len = __input.len();
6645 let mut payload_buf = [0; Self::ENCODED_LEN];
6646 let mut buf = if avail_len < Self::ENCODED_LEN {
6647 payload_buf[0..avail_len].copy_from_slice(__input);
6648 Bytes::new(&payload_buf)
6649 } else {
6650 Bytes::new(__input)
6651 };
6652 let mut __struct = Self::default();
6653 __struct.current_consumed = buf.get_i32_le();
6654 __struct.energy_consumed = buf.get_i32_le();
6655 __struct.temperature = buf.get_i16_le();
6656 for v in &mut __struct.voltages {
6657 let val = buf.get_u16_le();
6658 *v = val;
6659 }
6660 __struct.current_battery = buf.get_i16_le();
6661 __struct.id = buf.get_u8();
6662 let tmp = buf.get_u8();
6663 __struct.battery_function =
6664 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6665 enum_type: "MavBatteryFunction",
6666 value: tmp as u32,
6667 })?;
6668 let tmp = buf.get_u8();
6669 __struct.mavtype =
6670 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6671 enum_type: "MavBatteryType",
6672 value: tmp as u32,
6673 })?;
6674 __struct.battery_remaining = buf.get_i8();
6675 __struct.time_remaining = buf.get_i32_le();
6676 let tmp = buf.get_u8();
6677 __struct.charge_state =
6678 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6679 enum_type: "MavBatteryChargeState",
6680 value: tmp as u32,
6681 })?;
6682 for v in &mut __struct.voltages_ext {
6683 let val = buf.get_u16_le();
6684 *v = val;
6685 }
6686 let tmp = buf.get_u8();
6687 __struct.mode =
6688 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6689 enum_type: "MavBatteryMode",
6690 value: tmp as u32,
6691 })?;
6692 let tmp = buf.get_u32_le();
6693 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6694 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6695 flag_type: "MavBatteryFault",
6696 value: tmp as u32,
6697 })?;
6698 Ok(__struct)
6699 }
6700 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6701 let mut __tmp = BytesMut::new(bytes);
6702 #[allow(clippy::absurd_extreme_comparisons)]
6703 #[allow(unused_comparisons)]
6704 if __tmp.remaining() < Self::ENCODED_LEN {
6705 panic!(
6706 "buffer is too small (need {} bytes, but got {})",
6707 Self::ENCODED_LEN,
6708 __tmp.remaining(),
6709 )
6710 }
6711 __tmp.put_i32_le(self.current_consumed);
6712 __tmp.put_i32_le(self.energy_consumed);
6713 __tmp.put_i16_le(self.temperature);
6714 for val in &self.voltages {
6715 __tmp.put_u16_le(*val);
6716 }
6717 __tmp.put_i16_le(self.current_battery);
6718 __tmp.put_u8(self.id);
6719 __tmp.put_u8(self.battery_function as u8);
6720 __tmp.put_u8(self.mavtype as u8);
6721 __tmp.put_i8(self.battery_remaining);
6722 __tmp.put_i32_le(self.time_remaining);
6723 __tmp.put_u8(self.charge_state as u8);
6724 for val in &self.voltages_ext {
6725 __tmp.put_u16_le(*val);
6726 }
6727 __tmp.put_u8(self.mode as u8);
6728 __tmp.put_u32_le(self.fault_bitmask.bits());
6729 if matches!(version, MavlinkVersion::V2) {
6730 let len = __tmp.len();
6731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6732 } else {
6733 __tmp.len()
6734 }
6735 }
6736}
6737#[doc = "id: 257"]
6738#[doc = "Report button state change."]
6739#[derive(Debug, Clone, PartialEq)]
6740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6742pub struct BUTTON_CHANGE_DATA {
6743 #[doc = "Timestamp (time since system boot)."]
6744 pub time_boot_ms: u32,
6745 #[doc = "Time of last change of button state."]
6746 pub last_change_ms: u32,
6747 #[doc = "Bitmap for state of buttons."]
6748 pub state: u8,
6749}
6750impl BUTTON_CHANGE_DATA {
6751 pub const ENCODED_LEN: usize = 9usize;
6752 pub const DEFAULT: Self = Self {
6753 time_boot_ms: 0_u32,
6754 last_change_ms: 0_u32,
6755 state: 0_u8,
6756 };
6757 #[cfg(feature = "arbitrary")]
6758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6759 use arbitrary::{Arbitrary, Unstructured};
6760 let mut buf = [0u8; 1024];
6761 rng.fill_bytes(&mut buf);
6762 let mut unstructured = Unstructured::new(&buf);
6763 Self::arbitrary(&mut unstructured).unwrap_or_default()
6764 }
6765}
6766impl Default for BUTTON_CHANGE_DATA {
6767 fn default() -> Self {
6768 Self::DEFAULT.clone()
6769 }
6770}
6771impl MessageData for BUTTON_CHANGE_DATA {
6772 type Message = MavMessage;
6773 const ID: u32 = 257u32;
6774 const NAME: &'static str = "BUTTON_CHANGE";
6775 const EXTRA_CRC: u8 = 131u8;
6776 const ENCODED_LEN: usize = 9usize;
6777 fn deser(
6778 _version: MavlinkVersion,
6779 __input: &[u8],
6780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6781 let avail_len = __input.len();
6782 let mut payload_buf = [0; Self::ENCODED_LEN];
6783 let mut buf = if avail_len < Self::ENCODED_LEN {
6784 payload_buf[0..avail_len].copy_from_slice(__input);
6785 Bytes::new(&payload_buf)
6786 } else {
6787 Bytes::new(__input)
6788 };
6789 let mut __struct = Self::default();
6790 __struct.time_boot_ms = buf.get_u32_le();
6791 __struct.last_change_ms = buf.get_u32_le();
6792 __struct.state = buf.get_u8();
6793 Ok(__struct)
6794 }
6795 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6796 let mut __tmp = BytesMut::new(bytes);
6797 #[allow(clippy::absurd_extreme_comparisons)]
6798 #[allow(unused_comparisons)]
6799 if __tmp.remaining() < Self::ENCODED_LEN {
6800 panic!(
6801 "buffer is too small (need {} bytes, but got {})",
6802 Self::ENCODED_LEN,
6803 __tmp.remaining(),
6804 )
6805 }
6806 __tmp.put_u32_le(self.time_boot_ms);
6807 __tmp.put_u32_le(self.last_change_ms);
6808 __tmp.put_u8(self.state);
6809 if matches!(version, MavlinkVersion::V2) {
6810 let len = __tmp.len();
6811 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6812 } else {
6813 __tmp.len()
6814 }
6815 }
6816}
6817#[doc = "id: 262"]
6818#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6819#[derive(Debug, Clone, PartialEq)]
6820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6821#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6822pub struct CAMERA_CAPTURE_STATUS_DATA {
6823 #[doc = "Timestamp (time since system boot)."]
6824 pub time_boot_ms: u32,
6825 #[doc = "Image capture interval"]
6826 pub image_interval: f32,
6827 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
6828 pub recording_time_ms: u32,
6829 #[doc = "Available storage capacity."]
6830 pub available_capacity: f32,
6831 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
6832 pub image_status: u8,
6833 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
6834 pub video_status: u8,
6835 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
6836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6837 pub image_count: i32,
6838 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6839 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6840 pub camera_device_id: u8,
6841}
6842impl CAMERA_CAPTURE_STATUS_DATA {
6843 pub const ENCODED_LEN: usize = 23usize;
6844 pub const DEFAULT: Self = Self {
6845 time_boot_ms: 0_u32,
6846 image_interval: 0.0_f32,
6847 recording_time_ms: 0_u32,
6848 available_capacity: 0.0_f32,
6849 image_status: 0_u8,
6850 video_status: 0_u8,
6851 image_count: 0_i32,
6852 camera_device_id: 0_u8,
6853 };
6854 #[cfg(feature = "arbitrary")]
6855 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6856 use arbitrary::{Arbitrary, Unstructured};
6857 let mut buf = [0u8; 1024];
6858 rng.fill_bytes(&mut buf);
6859 let mut unstructured = Unstructured::new(&buf);
6860 Self::arbitrary(&mut unstructured).unwrap_or_default()
6861 }
6862}
6863impl Default for CAMERA_CAPTURE_STATUS_DATA {
6864 fn default() -> Self {
6865 Self::DEFAULT.clone()
6866 }
6867}
6868impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
6869 type Message = MavMessage;
6870 const ID: u32 = 262u32;
6871 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
6872 const EXTRA_CRC: u8 = 12u8;
6873 const ENCODED_LEN: usize = 23usize;
6874 fn deser(
6875 _version: MavlinkVersion,
6876 __input: &[u8],
6877 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6878 let avail_len = __input.len();
6879 let mut payload_buf = [0; Self::ENCODED_LEN];
6880 let mut buf = if avail_len < Self::ENCODED_LEN {
6881 payload_buf[0..avail_len].copy_from_slice(__input);
6882 Bytes::new(&payload_buf)
6883 } else {
6884 Bytes::new(__input)
6885 };
6886 let mut __struct = Self::default();
6887 __struct.time_boot_ms = buf.get_u32_le();
6888 __struct.image_interval = buf.get_f32_le();
6889 __struct.recording_time_ms = buf.get_u32_le();
6890 __struct.available_capacity = buf.get_f32_le();
6891 __struct.image_status = buf.get_u8();
6892 __struct.video_status = buf.get_u8();
6893 __struct.image_count = buf.get_i32_le();
6894 __struct.camera_device_id = buf.get_u8();
6895 Ok(__struct)
6896 }
6897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6898 let mut __tmp = BytesMut::new(bytes);
6899 #[allow(clippy::absurd_extreme_comparisons)]
6900 #[allow(unused_comparisons)]
6901 if __tmp.remaining() < Self::ENCODED_LEN {
6902 panic!(
6903 "buffer is too small (need {} bytes, but got {})",
6904 Self::ENCODED_LEN,
6905 __tmp.remaining(),
6906 )
6907 }
6908 __tmp.put_u32_le(self.time_boot_ms);
6909 __tmp.put_f32_le(self.image_interval);
6910 __tmp.put_u32_le(self.recording_time_ms);
6911 __tmp.put_f32_le(self.available_capacity);
6912 __tmp.put_u8(self.image_status);
6913 __tmp.put_u8(self.video_status);
6914 __tmp.put_i32_le(self.image_count);
6915 __tmp.put_u8(self.camera_device_id);
6916 if matches!(version, MavlinkVersion::V2) {
6917 let len = __tmp.len();
6918 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6919 } else {
6920 __tmp.len()
6921 }
6922 }
6923}
6924#[doc = "id: 271"]
6925#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
6926#[derive(Debug, Clone, PartialEq)]
6927#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6928#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6929pub struct CAMERA_FOV_STATUS_DATA {
6930 #[doc = "Timestamp (time since system boot)."]
6931 pub time_boot_ms: u32,
6932 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
6933 pub lat_camera: i32,
6934 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
6935 pub lon_camera: i32,
6936 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
6937 pub alt_camera: i32,
6938 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6939 pub lat_image: i32,
6940 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6941 pub lon_image: i32,
6942 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
6943 pub alt_image: i32,
6944 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6946 pub q: [f32; 4],
6947 #[doc = "Horizontal field of view (NaN if unknown)."]
6948 pub hfov: f32,
6949 #[doc = "Vertical field of view (NaN if unknown)."]
6950 pub vfov: f32,
6951 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
6952 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6953 pub camera_device_id: u8,
6954}
6955impl CAMERA_FOV_STATUS_DATA {
6956 pub const ENCODED_LEN: usize = 53usize;
6957 pub const DEFAULT: Self = Self {
6958 time_boot_ms: 0_u32,
6959 lat_camera: 0_i32,
6960 lon_camera: 0_i32,
6961 alt_camera: 0_i32,
6962 lat_image: 0_i32,
6963 lon_image: 0_i32,
6964 alt_image: 0_i32,
6965 q: [0.0_f32; 4usize],
6966 hfov: 0.0_f32,
6967 vfov: 0.0_f32,
6968 camera_device_id: 0_u8,
6969 };
6970 #[cfg(feature = "arbitrary")]
6971 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6972 use arbitrary::{Arbitrary, Unstructured};
6973 let mut buf = [0u8; 1024];
6974 rng.fill_bytes(&mut buf);
6975 let mut unstructured = Unstructured::new(&buf);
6976 Self::arbitrary(&mut unstructured).unwrap_or_default()
6977 }
6978}
6979impl Default for CAMERA_FOV_STATUS_DATA {
6980 fn default() -> Self {
6981 Self::DEFAULT.clone()
6982 }
6983}
6984impl MessageData for CAMERA_FOV_STATUS_DATA {
6985 type Message = MavMessage;
6986 const ID: u32 = 271u32;
6987 const NAME: &'static str = "CAMERA_FOV_STATUS";
6988 const EXTRA_CRC: u8 = 22u8;
6989 const ENCODED_LEN: usize = 53usize;
6990 fn deser(
6991 _version: MavlinkVersion,
6992 __input: &[u8],
6993 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6994 let avail_len = __input.len();
6995 let mut payload_buf = [0; Self::ENCODED_LEN];
6996 let mut buf = if avail_len < Self::ENCODED_LEN {
6997 payload_buf[0..avail_len].copy_from_slice(__input);
6998 Bytes::new(&payload_buf)
6999 } else {
7000 Bytes::new(__input)
7001 };
7002 let mut __struct = Self::default();
7003 __struct.time_boot_ms = buf.get_u32_le();
7004 __struct.lat_camera = buf.get_i32_le();
7005 __struct.lon_camera = buf.get_i32_le();
7006 __struct.alt_camera = buf.get_i32_le();
7007 __struct.lat_image = buf.get_i32_le();
7008 __struct.lon_image = buf.get_i32_le();
7009 __struct.alt_image = buf.get_i32_le();
7010 for v in &mut __struct.q {
7011 let val = buf.get_f32_le();
7012 *v = val;
7013 }
7014 __struct.hfov = buf.get_f32_le();
7015 __struct.vfov = buf.get_f32_le();
7016 __struct.camera_device_id = buf.get_u8();
7017 Ok(__struct)
7018 }
7019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7020 let mut __tmp = BytesMut::new(bytes);
7021 #[allow(clippy::absurd_extreme_comparisons)]
7022 #[allow(unused_comparisons)]
7023 if __tmp.remaining() < Self::ENCODED_LEN {
7024 panic!(
7025 "buffer is too small (need {} bytes, but got {})",
7026 Self::ENCODED_LEN,
7027 __tmp.remaining(),
7028 )
7029 }
7030 __tmp.put_u32_le(self.time_boot_ms);
7031 __tmp.put_i32_le(self.lat_camera);
7032 __tmp.put_i32_le(self.lon_camera);
7033 __tmp.put_i32_le(self.alt_camera);
7034 __tmp.put_i32_le(self.lat_image);
7035 __tmp.put_i32_le(self.lon_image);
7036 __tmp.put_i32_le(self.alt_image);
7037 for val in &self.q {
7038 __tmp.put_f32_le(*val);
7039 }
7040 __tmp.put_f32_le(self.hfov);
7041 __tmp.put_f32_le(self.vfov);
7042 __tmp.put_u8(self.camera_device_id);
7043 if matches!(version, MavlinkVersion::V2) {
7044 let len = __tmp.len();
7045 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7046 } else {
7047 __tmp.len()
7048 }
7049 }
7050}
7051#[doc = "id: 263"]
7052#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7053#[derive(Debug, Clone, PartialEq)]
7054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7055#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7056pub struct CAMERA_IMAGE_CAPTURED_DATA {
7057 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7058 pub time_utc: u64,
7059 #[doc = "Timestamp (time since system boot)."]
7060 pub time_boot_ms: u32,
7061 #[doc = "Latitude where image was taken"]
7062 pub lat: i32,
7063 #[doc = "Longitude where capture was taken"]
7064 pub lon: i32,
7065 #[doc = "Altitude (MSL) where image was taken"]
7066 pub alt: i32,
7067 #[doc = "Altitude above ground"]
7068 pub relative_alt: i32,
7069 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7070 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7071 pub q: [f32; 4],
7072 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7073 pub image_index: i32,
7074 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7075 pub camera_id: u8,
7076 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7077 pub capture_result: i8,
7078 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7079 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7080 pub file_url: [u8; 205],
7081}
7082impl CAMERA_IMAGE_CAPTURED_DATA {
7083 pub const ENCODED_LEN: usize = 255usize;
7084 pub const DEFAULT: Self = Self {
7085 time_utc: 0_u64,
7086 time_boot_ms: 0_u32,
7087 lat: 0_i32,
7088 lon: 0_i32,
7089 alt: 0_i32,
7090 relative_alt: 0_i32,
7091 q: [0.0_f32; 4usize],
7092 image_index: 0_i32,
7093 camera_id: 0_u8,
7094 capture_result: 0_i8,
7095 file_url: [0_u8; 205usize],
7096 };
7097 #[cfg(feature = "arbitrary")]
7098 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7099 use arbitrary::{Arbitrary, Unstructured};
7100 let mut buf = [0u8; 1024];
7101 rng.fill_bytes(&mut buf);
7102 let mut unstructured = Unstructured::new(&buf);
7103 Self::arbitrary(&mut unstructured).unwrap_or_default()
7104 }
7105}
7106impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7107 fn default() -> Self {
7108 Self::DEFAULT.clone()
7109 }
7110}
7111impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7112 type Message = MavMessage;
7113 const ID: u32 = 263u32;
7114 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7115 const EXTRA_CRC: u8 = 133u8;
7116 const ENCODED_LEN: usize = 255usize;
7117 fn deser(
7118 _version: MavlinkVersion,
7119 __input: &[u8],
7120 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7121 let avail_len = __input.len();
7122 let mut payload_buf = [0; Self::ENCODED_LEN];
7123 let mut buf = if avail_len < Self::ENCODED_LEN {
7124 payload_buf[0..avail_len].copy_from_slice(__input);
7125 Bytes::new(&payload_buf)
7126 } else {
7127 Bytes::new(__input)
7128 };
7129 let mut __struct = Self::default();
7130 __struct.time_utc = buf.get_u64_le();
7131 __struct.time_boot_ms = buf.get_u32_le();
7132 __struct.lat = buf.get_i32_le();
7133 __struct.lon = buf.get_i32_le();
7134 __struct.alt = buf.get_i32_le();
7135 __struct.relative_alt = buf.get_i32_le();
7136 for v in &mut __struct.q {
7137 let val = buf.get_f32_le();
7138 *v = val;
7139 }
7140 __struct.image_index = buf.get_i32_le();
7141 __struct.camera_id = buf.get_u8();
7142 __struct.capture_result = buf.get_i8();
7143 for v in &mut __struct.file_url {
7144 let val = buf.get_u8();
7145 *v = val;
7146 }
7147 Ok(__struct)
7148 }
7149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7150 let mut __tmp = BytesMut::new(bytes);
7151 #[allow(clippy::absurd_extreme_comparisons)]
7152 #[allow(unused_comparisons)]
7153 if __tmp.remaining() < Self::ENCODED_LEN {
7154 panic!(
7155 "buffer is too small (need {} bytes, but got {})",
7156 Self::ENCODED_LEN,
7157 __tmp.remaining(),
7158 )
7159 }
7160 __tmp.put_u64_le(self.time_utc);
7161 __tmp.put_u32_le(self.time_boot_ms);
7162 __tmp.put_i32_le(self.lat);
7163 __tmp.put_i32_le(self.lon);
7164 __tmp.put_i32_le(self.alt);
7165 __tmp.put_i32_le(self.relative_alt);
7166 for val in &self.q {
7167 __tmp.put_f32_le(*val);
7168 }
7169 __tmp.put_i32_le(self.image_index);
7170 __tmp.put_u8(self.camera_id);
7171 __tmp.put_i8(self.capture_result);
7172 for val in &self.file_url {
7173 __tmp.put_u8(*val);
7174 }
7175 if matches!(version, MavlinkVersion::V2) {
7176 let len = __tmp.len();
7177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7178 } else {
7179 __tmp.len()
7180 }
7181 }
7182}
7183#[doc = "id: 259"]
7184#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7185#[derive(Debug, Clone, PartialEq)]
7186#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7187#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7188pub struct CAMERA_INFORMATION_DATA {
7189 #[doc = "Timestamp (time since system boot)."]
7190 pub time_boot_ms: u32,
7191 #[doc = "0xff). Use 0 if not known."]
7192 pub firmware_version: u32,
7193 #[doc = "Focal length. Use NaN if not known."]
7194 pub focal_length: f32,
7195 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7196 pub sensor_size_h: f32,
7197 #[doc = "Image sensor size vertical. Use NaN if not known."]
7198 pub sensor_size_v: f32,
7199 #[doc = "Bitmap of camera capability flags."]
7200 pub flags: CameraCapFlags,
7201 #[doc = "Horizontal image resolution. Use 0 if not known."]
7202 pub resolution_h: u16,
7203 #[doc = "Vertical image resolution. Use 0 if not known."]
7204 pub resolution_v: u16,
7205 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7206 pub cam_definition_version: u16,
7207 #[doc = "Name of the camera vendor"]
7208 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7209 pub vendor_name: [u8; 32],
7210 #[doc = "Name of the camera model"]
7211 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7212 pub model_name: [u8; 32],
7213 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7214 pub lens_id: u8,
7215 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7216 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7217 pub cam_definition_uri: [u8; 140],
7218 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7219 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7220 pub gimbal_device_id: u8,
7221 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7222 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7223 pub camera_device_id: u8,
7224}
7225impl CAMERA_INFORMATION_DATA {
7226 pub const ENCODED_LEN: usize = 237usize;
7227 pub const DEFAULT: Self = Self {
7228 time_boot_ms: 0_u32,
7229 firmware_version: 0_u32,
7230 focal_length: 0.0_f32,
7231 sensor_size_h: 0.0_f32,
7232 sensor_size_v: 0.0_f32,
7233 flags: CameraCapFlags::DEFAULT,
7234 resolution_h: 0_u16,
7235 resolution_v: 0_u16,
7236 cam_definition_version: 0_u16,
7237 vendor_name: [0_u8; 32usize],
7238 model_name: [0_u8; 32usize],
7239 lens_id: 0_u8,
7240 cam_definition_uri: [0_u8; 140usize],
7241 gimbal_device_id: 0_u8,
7242 camera_device_id: 0_u8,
7243 };
7244 #[cfg(feature = "arbitrary")]
7245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7246 use arbitrary::{Arbitrary, Unstructured};
7247 let mut buf = [0u8; 1024];
7248 rng.fill_bytes(&mut buf);
7249 let mut unstructured = Unstructured::new(&buf);
7250 Self::arbitrary(&mut unstructured).unwrap_or_default()
7251 }
7252}
7253impl Default for CAMERA_INFORMATION_DATA {
7254 fn default() -> Self {
7255 Self::DEFAULT.clone()
7256 }
7257}
7258impl MessageData for CAMERA_INFORMATION_DATA {
7259 type Message = MavMessage;
7260 const ID: u32 = 259u32;
7261 const NAME: &'static str = "CAMERA_INFORMATION";
7262 const EXTRA_CRC: u8 = 92u8;
7263 const ENCODED_LEN: usize = 237usize;
7264 fn deser(
7265 _version: MavlinkVersion,
7266 __input: &[u8],
7267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7268 let avail_len = __input.len();
7269 let mut payload_buf = [0; Self::ENCODED_LEN];
7270 let mut buf = if avail_len < Self::ENCODED_LEN {
7271 payload_buf[0..avail_len].copy_from_slice(__input);
7272 Bytes::new(&payload_buf)
7273 } else {
7274 Bytes::new(__input)
7275 };
7276 let mut __struct = Self::default();
7277 __struct.time_boot_ms = buf.get_u32_le();
7278 __struct.firmware_version = buf.get_u32_le();
7279 __struct.focal_length = buf.get_f32_le();
7280 __struct.sensor_size_h = buf.get_f32_le();
7281 __struct.sensor_size_v = buf.get_f32_le();
7282 let tmp = buf.get_u32_le();
7283 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7284 ::mavlink_core::error::ParserError::InvalidFlag {
7285 flag_type: "CameraCapFlags",
7286 value: tmp as u32,
7287 },
7288 )?;
7289 __struct.resolution_h = buf.get_u16_le();
7290 __struct.resolution_v = buf.get_u16_le();
7291 __struct.cam_definition_version = buf.get_u16_le();
7292 for v in &mut __struct.vendor_name {
7293 let val = buf.get_u8();
7294 *v = val;
7295 }
7296 for v in &mut __struct.model_name {
7297 let val = buf.get_u8();
7298 *v = val;
7299 }
7300 __struct.lens_id = buf.get_u8();
7301 for v in &mut __struct.cam_definition_uri {
7302 let val = buf.get_u8();
7303 *v = val;
7304 }
7305 __struct.gimbal_device_id = buf.get_u8();
7306 __struct.camera_device_id = buf.get_u8();
7307 Ok(__struct)
7308 }
7309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7310 let mut __tmp = BytesMut::new(bytes);
7311 #[allow(clippy::absurd_extreme_comparisons)]
7312 #[allow(unused_comparisons)]
7313 if __tmp.remaining() < Self::ENCODED_LEN {
7314 panic!(
7315 "buffer is too small (need {} bytes, but got {})",
7316 Self::ENCODED_LEN,
7317 __tmp.remaining(),
7318 )
7319 }
7320 __tmp.put_u32_le(self.time_boot_ms);
7321 __tmp.put_u32_le(self.firmware_version);
7322 __tmp.put_f32_le(self.focal_length);
7323 __tmp.put_f32_le(self.sensor_size_h);
7324 __tmp.put_f32_le(self.sensor_size_v);
7325 __tmp.put_u32_le(self.flags.bits());
7326 __tmp.put_u16_le(self.resolution_h);
7327 __tmp.put_u16_le(self.resolution_v);
7328 __tmp.put_u16_le(self.cam_definition_version);
7329 for val in &self.vendor_name {
7330 __tmp.put_u8(*val);
7331 }
7332 for val in &self.model_name {
7333 __tmp.put_u8(*val);
7334 }
7335 __tmp.put_u8(self.lens_id);
7336 for val in &self.cam_definition_uri {
7337 __tmp.put_u8(*val);
7338 }
7339 __tmp.put_u8(self.gimbal_device_id);
7340 __tmp.put_u8(self.camera_device_id);
7341 if matches!(version, MavlinkVersion::V2) {
7342 let len = __tmp.len();
7343 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7344 } else {
7345 __tmp.len()
7346 }
7347 }
7348}
7349#[doc = "id: 260"]
7350#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7351#[derive(Debug, Clone, PartialEq)]
7352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7354pub struct CAMERA_SETTINGS_DATA {
7355 #[doc = "Timestamp (time since system boot)."]
7356 pub time_boot_ms: u32,
7357 #[doc = "Camera mode"]
7358 pub mode_id: CameraMode,
7359 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7360 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7361 pub zoomLevel: f32,
7362 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7363 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7364 pub focusLevel: f32,
7365 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7366 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7367 pub camera_device_id: u8,
7368}
7369impl CAMERA_SETTINGS_DATA {
7370 pub const ENCODED_LEN: usize = 14usize;
7371 pub const DEFAULT: Self = Self {
7372 time_boot_ms: 0_u32,
7373 mode_id: CameraMode::DEFAULT,
7374 zoomLevel: 0.0_f32,
7375 focusLevel: 0.0_f32,
7376 camera_device_id: 0_u8,
7377 };
7378 #[cfg(feature = "arbitrary")]
7379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7380 use arbitrary::{Arbitrary, Unstructured};
7381 let mut buf = [0u8; 1024];
7382 rng.fill_bytes(&mut buf);
7383 let mut unstructured = Unstructured::new(&buf);
7384 Self::arbitrary(&mut unstructured).unwrap_or_default()
7385 }
7386}
7387impl Default for CAMERA_SETTINGS_DATA {
7388 fn default() -> Self {
7389 Self::DEFAULT.clone()
7390 }
7391}
7392impl MessageData for CAMERA_SETTINGS_DATA {
7393 type Message = MavMessage;
7394 const ID: u32 = 260u32;
7395 const NAME: &'static str = "CAMERA_SETTINGS";
7396 const EXTRA_CRC: u8 = 146u8;
7397 const ENCODED_LEN: usize = 14usize;
7398 fn deser(
7399 _version: MavlinkVersion,
7400 __input: &[u8],
7401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7402 let avail_len = __input.len();
7403 let mut payload_buf = [0; Self::ENCODED_LEN];
7404 let mut buf = if avail_len < Self::ENCODED_LEN {
7405 payload_buf[0..avail_len].copy_from_slice(__input);
7406 Bytes::new(&payload_buf)
7407 } else {
7408 Bytes::new(__input)
7409 };
7410 let mut __struct = Self::default();
7411 __struct.time_boot_ms = buf.get_u32_le();
7412 let tmp = buf.get_u8();
7413 __struct.mode_id =
7414 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7415 enum_type: "CameraMode",
7416 value: tmp as u32,
7417 })?;
7418 __struct.zoomLevel = buf.get_f32_le();
7419 __struct.focusLevel = buf.get_f32_le();
7420 __struct.camera_device_id = buf.get_u8();
7421 Ok(__struct)
7422 }
7423 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7424 let mut __tmp = BytesMut::new(bytes);
7425 #[allow(clippy::absurd_extreme_comparisons)]
7426 #[allow(unused_comparisons)]
7427 if __tmp.remaining() < Self::ENCODED_LEN {
7428 panic!(
7429 "buffer is too small (need {} bytes, but got {})",
7430 Self::ENCODED_LEN,
7431 __tmp.remaining(),
7432 )
7433 }
7434 __tmp.put_u32_le(self.time_boot_ms);
7435 __tmp.put_u8(self.mode_id as u8);
7436 __tmp.put_f32_le(self.zoomLevel);
7437 __tmp.put_f32_le(self.focusLevel);
7438 __tmp.put_u8(self.camera_device_id);
7439 if matches!(version, MavlinkVersion::V2) {
7440 let len = __tmp.len();
7441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7442 } else {
7443 __tmp.len()
7444 }
7445 }
7446}
7447#[doc = "id: 277"]
7448#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7449#[derive(Debug, Clone, PartialEq)]
7450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7452pub struct CAMERA_THERMAL_RANGE_DATA {
7453 #[doc = "Timestamp (time since system boot)."]
7454 pub time_boot_ms: u32,
7455 #[doc = "Temperature max."]
7456 pub max: f32,
7457 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7458 pub max_point_x: f32,
7459 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7460 pub max_point_y: f32,
7461 #[doc = "Temperature min."]
7462 pub min: f32,
7463 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7464 pub min_point_x: f32,
7465 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7466 pub min_point_y: f32,
7467 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7468 pub stream_id: u8,
7469 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7470 pub camera_device_id: u8,
7471}
7472impl CAMERA_THERMAL_RANGE_DATA {
7473 pub const ENCODED_LEN: usize = 30usize;
7474 pub const DEFAULT: Self = Self {
7475 time_boot_ms: 0_u32,
7476 max: 0.0_f32,
7477 max_point_x: 0.0_f32,
7478 max_point_y: 0.0_f32,
7479 min: 0.0_f32,
7480 min_point_x: 0.0_f32,
7481 min_point_y: 0.0_f32,
7482 stream_id: 0_u8,
7483 camera_device_id: 0_u8,
7484 };
7485 #[cfg(feature = "arbitrary")]
7486 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7487 use arbitrary::{Arbitrary, Unstructured};
7488 let mut buf = [0u8; 1024];
7489 rng.fill_bytes(&mut buf);
7490 let mut unstructured = Unstructured::new(&buf);
7491 Self::arbitrary(&mut unstructured).unwrap_or_default()
7492 }
7493}
7494impl Default for CAMERA_THERMAL_RANGE_DATA {
7495 fn default() -> Self {
7496 Self::DEFAULT.clone()
7497 }
7498}
7499impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7500 type Message = MavMessage;
7501 const ID: u32 = 277u32;
7502 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7503 const EXTRA_CRC: u8 = 62u8;
7504 const ENCODED_LEN: usize = 30usize;
7505 fn deser(
7506 _version: MavlinkVersion,
7507 __input: &[u8],
7508 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7509 let avail_len = __input.len();
7510 let mut payload_buf = [0; Self::ENCODED_LEN];
7511 let mut buf = if avail_len < Self::ENCODED_LEN {
7512 payload_buf[0..avail_len].copy_from_slice(__input);
7513 Bytes::new(&payload_buf)
7514 } else {
7515 Bytes::new(__input)
7516 };
7517 let mut __struct = Self::default();
7518 __struct.time_boot_ms = buf.get_u32_le();
7519 __struct.max = buf.get_f32_le();
7520 __struct.max_point_x = buf.get_f32_le();
7521 __struct.max_point_y = buf.get_f32_le();
7522 __struct.min = buf.get_f32_le();
7523 __struct.min_point_x = buf.get_f32_le();
7524 __struct.min_point_y = buf.get_f32_le();
7525 __struct.stream_id = buf.get_u8();
7526 __struct.camera_device_id = buf.get_u8();
7527 Ok(__struct)
7528 }
7529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7530 let mut __tmp = BytesMut::new(bytes);
7531 #[allow(clippy::absurd_extreme_comparisons)]
7532 #[allow(unused_comparisons)]
7533 if __tmp.remaining() < Self::ENCODED_LEN {
7534 panic!(
7535 "buffer is too small (need {} bytes, but got {})",
7536 Self::ENCODED_LEN,
7537 __tmp.remaining(),
7538 )
7539 }
7540 __tmp.put_u32_le(self.time_boot_ms);
7541 __tmp.put_f32_le(self.max);
7542 __tmp.put_f32_le(self.max_point_x);
7543 __tmp.put_f32_le(self.max_point_y);
7544 __tmp.put_f32_le(self.min);
7545 __tmp.put_f32_le(self.min_point_x);
7546 __tmp.put_f32_le(self.min_point_y);
7547 __tmp.put_u8(self.stream_id);
7548 __tmp.put_u8(self.camera_device_id);
7549 if matches!(version, MavlinkVersion::V2) {
7550 let len = __tmp.len();
7551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7552 } else {
7553 __tmp.len()
7554 }
7555 }
7556}
7557#[doc = "id: 276"]
7558#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7559#[derive(Debug, Clone, PartialEq)]
7560#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7561#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7562pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7563 #[doc = "Latitude of tracked object"]
7564 pub lat: i32,
7565 #[doc = "Longitude of tracked object"]
7566 pub lon: i32,
7567 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7568 pub alt: f32,
7569 #[doc = "Horizontal accuracy. NAN if unknown"]
7570 pub h_acc: f32,
7571 #[doc = "Vertical accuracy. NAN if unknown"]
7572 pub v_acc: f32,
7573 #[doc = "North velocity of tracked object. NAN if unknown"]
7574 pub vel_n: f32,
7575 #[doc = "East velocity of tracked object. NAN if unknown"]
7576 pub vel_e: f32,
7577 #[doc = "Down velocity of tracked object. NAN if unknown"]
7578 pub vel_d: f32,
7579 #[doc = "Velocity accuracy. NAN if unknown"]
7580 pub vel_acc: f32,
7581 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7582 pub dist: f32,
7583 #[doc = "Heading in radians, in NED. NAN if unknown"]
7584 pub hdg: f32,
7585 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7586 pub hdg_acc: f32,
7587 #[doc = "Current tracking status"]
7588 pub tracking_status: CameraTrackingStatusFlags,
7589 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7590 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7591 pub camera_device_id: u8,
7592}
7593impl CAMERA_TRACKING_GEO_STATUS_DATA {
7594 pub const ENCODED_LEN: usize = 50usize;
7595 pub const DEFAULT: Self = Self {
7596 lat: 0_i32,
7597 lon: 0_i32,
7598 alt: 0.0_f32,
7599 h_acc: 0.0_f32,
7600 v_acc: 0.0_f32,
7601 vel_n: 0.0_f32,
7602 vel_e: 0.0_f32,
7603 vel_d: 0.0_f32,
7604 vel_acc: 0.0_f32,
7605 dist: 0.0_f32,
7606 hdg: 0.0_f32,
7607 hdg_acc: 0.0_f32,
7608 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7609 camera_device_id: 0_u8,
7610 };
7611 #[cfg(feature = "arbitrary")]
7612 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7613 use arbitrary::{Arbitrary, Unstructured};
7614 let mut buf = [0u8; 1024];
7615 rng.fill_bytes(&mut buf);
7616 let mut unstructured = Unstructured::new(&buf);
7617 Self::arbitrary(&mut unstructured).unwrap_or_default()
7618 }
7619}
7620impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7621 fn default() -> Self {
7622 Self::DEFAULT.clone()
7623 }
7624}
7625impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7626 type Message = MavMessage;
7627 const ID: u32 = 276u32;
7628 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7629 const EXTRA_CRC: u8 = 18u8;
7630 const ENCODED_LEN: usize = 50usize;
7631 fn deser(
7632 _version: MavlinkVersion,
7633 __input: &[u8],
7634 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7635 let avail_len = __input.len();
7636 let mut payload_buf = [0; Self::ENCODED_LEN];
7637 let mut buf = if avail_len < Self::ENCODED_LEN {
7638 payload_buf[0..avail_len].copy_from_slice(__input);
7639 Bytes::new(&payload_buf)
7640 } else {
7641 Bytes::new(__input)
7642 };
7643 let mut __struct = Self::default();
7644 __struct.lat = buf.get_i32_le();
7645 __struct.lon = buf.get_i32_le();
7646 __struct.alt = buf.get_f32_le();
7647 __struct.h_acc = buf.get_f32_le();
7648 __struct.v_acc = buf.get_f32_le();
7649 __struct.vel_n = buf.get_f32_le();
7650 __struct.vel_e = buf.get_f32_le();
7651 __struct.vel_d = buf.get_f32_le();
7652 __struct.vel_acc = buf.get_f32_le();
7653 __struct.dist = buf.get_f32_le();
7654 __struct.hdg = buf.get_f32_le();
7655 __struct.hdg_acc = buf.get_f32_le();
7656 let tmp = buf.get_u8();
7657 __struct.tracking_status =
7658 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7659 enum_type: "CameraTrackingStatusFlags",
7660 value: tmp as u32,
7661 })?;
7662 __struct.camera_device_id = buf.get_u8();
7663 Ok(__struct)
7664 }
7665 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7666 let mut __tmp = BytesMut::new(bytes);
7667 #[allow(clippy::absurd_extreme_comparisons)]
7668 #[allow(unused_comparisons)]
7669 if __tmp.remaining() < Self::ENCODED_LEN {
7670 panic!(
7671 "buffer is too small (need {} bytes, but got {})",
7672 Self::ENCODED_LEN,
7673 __tmp.remaining(),
7674 )
7675 }
7676 __tmp.put_i32_le(self.lat);
7677 __tmp.put_i32_le(self.lon);
7678 __tmp.put_f32_le(self.alt);
7679 __tmp.put_f32_le(self.h_acc);
7680 __tmp.put_f32_le(self.v_acc);
7681 __tmp.put_f32_le(self.vel_n);
7682 __tmp.put_f32_le(self.vel_e);
7683 __tmp.put_f32_le(self.vel_d);
7684 __tmp.put_f32_le(self.vel_acc);
7685 __tmp.put_f32_le(self.dist);
7686 __tmp.put_f32_le(self.hdg);
7687 __tmp.put_f32_le(self.hdg_acc);
7688 __tmp.put_u8(self.tracking_status as u8);
7689 __tmp.put_u8(self.camera_device_id);
7690 if matches!(version, MavlinkVersion::V2) {
7691 let len = __tmp.len();
7692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7693 } else {
7694 __tmp.len()
7695 }
7696 }
7697}
7698#[doc = "id: 275"]
7699#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7700#[derive(Debug, Clone, PartialEq)]
7701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7703pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
7704 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7705 pub point_x: f32,
7706 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7707 pub point_y: f32,
7708 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
7709 pub radius: f32,
7710 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7711 pub rec_top_x: f32,
7712 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7713 pub rec_top_y: f32,
7714 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
7715 pub rec_bottom_x: f32,
7716 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
7717 pub rec_bottom_y: f32,
7718 #[doc = "Current tracking status"]
7719 pub tracking_status: CameraTrackingStatusFlags,
7720 #[doc = "Current tracking mode"]
7721 pub tracking_mode: CameraTrackingMode,
7722 #[doc = "Defines location of target data"]
7723 pub target_data: CameraTrackingTargetData,
7724 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7725 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7726 pub camera_device_id: u8,
7727}
7728impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
7729 pub const ENCODED_LEN: usize = 32usize;
7730 pub const DEFAULT: Self = Self {
7731 point_x: 0.0_f32,
7732 point_y: 0.0_f32,
7733 radius: 0.0_f32,
7734 rec_top_x: 0.0_f32,
7735 rec_top_y: 0.0_f32,
7736 rec_bottom_x: 0.0_f32,
7737 rec_bottom_y: 0.0_f32,
7738 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7739 tracking_mode: CameraTrackingMode::DEFAULT,
7740 target_data: CameraTrackingTargetData::DEFAULT,
7741 camera_device_id: 0_u8,
7742 };
7743 #[cfg(feature = "arbitrary")]
7744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7745 use arbitrary::{Arbitrary, Unstructured};
7746 let mut buf = [0u8; 1024];
7747 rng.fill_bytes(&mut buf);
7748 let mut unstructured = Unstructured::new(&buf);
7749 Self::arbitrary(&mut unstructured).unwrap_or_default()
7750 }
7751}
7752impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7753 fn default() -> Self {
7754 Self::DEFAULT.clone()
7755 }
7756}
7757impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
7758 type Message = MavMessage;
7759 const ID: u32 = 275u32;
7760 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
7761 const EXTRA_CRC: u8 = 126u8;
7762 const ENCODED_LEN: usize = 32usize;
7763 fn deser(
7764 _version: MavlinkVersion,
7765 __input: &[u8],
7766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7767 let avail_len = __input.len();
7768 let mut payload_buf = [0; Self::ENCODED_LEN];
7769 let mut buf = if avail_len < Self::ENCODED_LEN {
7770 payload_buf[0..avail_len].copy_from_slice(__input);
7771 Bytes::new(&payload_buf)
7772 } else {
7773 Bytes::new(__input)
7774 };
7775 let mut __struct = Self::default();
7776 __struct.point_x = buf.get_f32_le();
7777 __struct.point_y = buf.get_f32_le();
7778 __struct.radius = buf.get_f32_le();
7779 __struct.rec_top_x = buf.get_f32_le();
7780 __struct.rec_top_y = buf.get_f32_le();
7781 __struct.rec_bottom_x = buf.get_f32_le();
7782 __struct.rec_bottom_y = buf.get_f32_le();
7783 let tmp = buf.get_u8();
7784 __struct.tracking_status =
7785 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7786 enum_type: "CameraTrackingStatusFlags",
7787 value: tmp as u32,
7788 })?;
7789 let tmp = buf.get_u8();
7790 __struct.tracking_mode =
7791 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7792 enum_type: "CameraTrackingMode",
7793 value: tmp as u32,
7794 })?;
7795 let tmp = buf.get_u8();
7796 __struct.target_data =
7797 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
7798 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7799 flag_type: "CameraTrackingTargetData",
7800 value: tmp as u32,
7801 })?;
7802 __struct.camera_device_id = buf.get_u8();
7803 Ok(__struct)
7804 }
7805 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7806 let mut __tmp = BytesMut::new(bytes);
7807 #[allow(clippy::absurd_extreme_comparisons)]
7808 #[allow(unused_comparisons)]
7809 if __tmp.remaining() < Self::ENCODED_LEN {
7810 panic!(
7811 "buffer is too small (need {} bytes, but got {})",
7812 Self::ENCODED_LEN,
7813 __tmp.remaining(),
7814 )
7815 }
7816 __tmp.put_f32_le(self.point_x);
7817 __tmp.put_f32_le(self.point_y);
7818 __tmp.put_f32_le(self.radius);
7819 __tmp.put_f32_le(self.rec_top_x);
7820 __tmp.put_f32_le(self.rec_top_y);
7821 __tmp.put_f32_le(self.rec_bottom_x);
7822 __tmp.put_f32_le(self.rec_bottom_y);
7823 __tmp.put_u8(self.tracking_status as u8);
7824 __tmp.put_u8(self.tracking_mode as u8);
7825 __tmp.put_u8(self.target_data.bits());
7826 __tmp.put_u8(self.camera_device_id);
7827 if matches!(version, MavlinkVersion::V2) {
7828 let len = __tmp.len();
7829 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7830 } else {
7831 __tmp.len()
7832 }
7833 }
7834}
7835#[doc = "id: 112"]
7836#[doc = "Camera-IMU triggering and synchronisation message."]
7837#[derive(Debug, Clone, PartialEq)]
7838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7840pub struct CAMERA_TRIGGER_DATA {
7841 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7842 pub time_usec: u64,
7843 #[doc = "Image frame sequence"]
7844 pub seq: u32,
7845}
7846impl CAMERA_TRIGGER_DATA {
7847 pub const ENCODED_LEN: usize = 12usize;
7848 pub const DEFAULT: Self = Self {
7849 time_usec: 0_u64,
7850 seq: 0_u32,
7851 };
7852 #[cfg(feature = "arbitrary")]
7853 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7854 use arbitrary::{Arbitrary, Unstructured};
7855 let mut buf = [0u8; 1024];
7856 rng.fill_bytes(&mut buf);
7857 let mut unstructured = Unstructured::new(&buf);
7858 Self::arbitrary(&mut unstructured).unwrap_or_default()
7859 }
7860}
7861impl Default for CAMERA_TRIGGER_DATA {
7862 fn default() -> Self {
7863 Self::DEFAULT.clone()
7864 }
7865}
7866impl MessageData for CAMERA_TRIGGER_DATA {
7867 type Message = MavMessage;
7868 const ID: u32 = 112u32;
7869 const NAME: &'static str = "CAMERA_TRIGGER";
7870 const EXTRA_CRC: u8 = 174u8;
7871 const ENCODED_LEN: usize = 12usize;
7872 fn deser(
7873 _version: MavlinkVersion,
7874 __input: &[u8],
7875 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7876 let avail_len = __input.len();
7877 let mut payload_buf = [0; Self::ENCODED_LEN];
7878 let mut buf = if avail_len < Self::ENCODED_LEN {
7879 payload_buf[0..avail_len].copy_from_slice(__input);
7880 Bytes::new(&payload_buf)
7881 } else {
7882 Bytes::new(__input)
7883 };
7884 let mut __struct = Self::default();
7885 __struct.time_usec = buf.get_u64_le();
7886 __struct.seq = buf.get_u32_le();
7887 Ok(__struct)
7888 }
7889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7890 let mut __tmp = BytesMut::new(bytes);
7891 #[allow(clippy::absurd_extreme_comparisons)]
7892 #[allow(unused_comparisons)]
7893 if __tmp.remaining() < Self::ENCODED_LEN {
7894 panic!(
7895 "buffer is too small (need {} bytes, but got {})",
7896 Self::ENCODED_LEN,
7897 __tmp.remaining(),
7898 )
7899 }
7900 __tmp.put_u64_le(self.time_usec);
7901 __tmp.put_u32_le(self.seq);
7902 if matches!(version, MavlinkVersion::V2) {
7903 let len = __tmp.len();
7904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7905 } else {
7906 __tmp.len()
7907 }
7908 }
7909}
7910#[doc = "id: 387"]
7911#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
7912#[derive(Debug, Clone, PartialEq)]
7913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7915pub struct CANFD_FRAME_DATA {
7916 #[doc = "Frame ID"]
7917 pub id: u32,
7918 #[doc = "System ID."]
7919 pub target_system: u8,
7920 #[doc = "Component ID."]
7921 pub target_component: u8,
7922 #[doc = "bus number"]
7923 pub bus: u8,
7924 #[doc = "Frame length"]
7925 pub len: u8,
7926 #[doc = "Frame data"]
7927 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7928 pub data: [u8; 64],
7929}
7930impl CANFD_FRAME_DATA {
7931 pub const ENCODED_LEN: usize = 72usize;
7932 pub const DEFAULT: Self = Self {
7933 id: 0_u32,
7934 target_system: 0_u8,
7935 target_component: 0_u8,
7936 bus: 0_u8,
7937 len: 0_u8,
7938 data: [0_u8; 64usize],
7939 };
7940 #[cfg(feature = "arbitrary")]
7941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7942 use arbitrary::{Arbitrary, Unstructured};
7943 let mut buf = [0u8; 1024];
7944 rng.fill_bytes(&mut buf);
7945 let mut unstructured = Unstructured::new(&buf);
7946 Self::arbitrary(&mut unstructured).unwrap_or_default()
7947 }
7948}
7949impl Default for CANFD_FRAME_DATA {
7950 fn default() -> Self {
7951 Self::DEFAULT.clone()
7952 }
7953}
7954impl MessageData for CANFD_FRAME_DATA {
7955 type Message = MavMessage;
7956 const ID: u32 = 387u32;
7957 const NAME: &'static str = "CANFD_FRAME";
7958 const EXTRA_CRC: u8 = 4u8;
7959 const ENCODED_LEN: usize = 72usize;
7960 fn deser(
7961 _version: MavlinkVersion,
7962 __input: &[u8],
7963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7964 let avail_len = __input.len();
7965 let mut payload_buf = [0; Self::ENCODED_LEN];
7966 let mut buf = if avail_len < Self::ENCODED_LEN {
7967 payload_buf[0..avail_len].copy_from_slice(__input);
7968 Bytes::new(&payload_buf)
7969 } else {
7970 Bytes::new(__input)
7971 };
7972 let mut __struct = Self::default();
7973 __struct.id = buf.get_u32_le();
7974 __struct.target_system = buf.get_u8();
7975 __struct.target_component = buf.get_u8();
7976 __struct.bus = buf.get_u8();
7977 __struct.len = buf.get_u8();
7978 for v in &mut __struct.data {
7979 let val = buf.get_u8();
7980 *v = val;
7981 }
7982 Ok(__struct)
7983 }
7984 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7985 let mut __tmp = BytesMut::new(bytes);
7986 #[allow(clippy::absurd_extreme_comparisons)]
7987 #[allow(unused_comparisons)]
7988 if __tmp.remaining() < Self::ENCODED_LEN {
7989 panic!(
7990 "buffer is too small (need {} bytes, but got {})",
7991 Self::ENCODED_LEN,
7992 __tmp.remaining(),
7993 )
7994 }
7995 __tmp.put_u32_le(self.id);
7996 __tmp.put_u8(self.target_system);
7997 __tmp.put_u8(self.target_component);
7998 __tmp.put_u8(self.bus);
7999 __tmp.put_u8(self.len);
8000 for val in &self.data {
8001 __tmp.put_u8(*val);
8002 }
8003 if matches!(version, MavlinkVersion::V2) {
8004 let len = __tmp.len();
8005 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8006 } else {
8007 __tmp.len()
8008 }
8009 }
8010}
8011#[doc = "id: 388"]
8012#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8013#[derive(Debug, Clone, PartialEq)]
8014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8016pub struct CAN_FILTER_MODIFY_DATA {
8017 #[doc = "filter IDs, length num_ids"]
8018 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8019 pub ids: [u16; 16],
8020 #[doc = "System ID."]
8021 pub target_system: u8,
8022 #[doc = "Component ID."]
8023 pub target_component: u8,
8024 #[doc = "bus number"]
8025 pub bus: u8,
8026 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8027 pub operation: CanFilterOp,
8028 #[doc = "number of IDs in filter list"]
8029 pub num_ids: u8,
8030}
8031impl CAN_FILTER_MODIFY_DATA {
8032 pub const ENCODED_LEN: usize = 37usize;
8033 pub const DEFAULT: Self = Self {
8034 ids: [0_u16; 16usize],
8035 target_system: 0_u8,
8036 target_component: 0_u8,
8037 bus: 0_u8,
8038 operation: CanFilterOp::DEFAULT,
8039 num_ids: 0_u8,
8040 };
8041 #[cfg(feature = "arbitrary")]
8042 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8043 use arbitrary::{Arbitrary, Unstructured};
8044 let mut buf = [0u8; 1024];
8045 rng.fill_bytes(&mut buf);
8046 let mut unstructured = Unstructured::new(&buf);
8047 Self::arbitrary(&mut unstructured).unwrap_or_default()
8048 }
8049}
8050impl Default for CAN_FILTER_MODIFY_DATA {
8051 fn default() -> Self {
8052 Self::DEFAULT.clone()
8053 }
8054}
8055impl MessageData for CAN_FILTER_MODIFY_DATA {
8056 type Message = MavMessage;
8057 const ID: u32 = 388u32;
8058 const NAME: &'static str = "CAN_FILTER_MODIFY";
8059 const EXTRA_CRC: u8 = 8u8;
8060 const ENCODED_LEN: usize = 37usize;
8061 fn deser(
8062 _version: MavlinkVersion,
8063 __input: &[u8],
8064 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8065 let avail_len = __input.len();
8066 let mut payload_buf = [0; Self::ENCODED_LEN];
8067 let mut buf = if avail_len < Self::ENCODED_LEN {
8068 payload_buf[0..avail_len].copy_from_slice(__input);
8069 Bytes::new(&payload_buf)
8070 } else {
8071 Bytes::new(__input)
8072 };
8073 let mut __struct = Self::default();
8074 for v in &mut __struct.ids {
8075 let val = buf.get_u16_le();
8076 *v = val;
8077 }
8078 __struct.target_system = buf.get_u8();
8079 __struct.target_component = buf.get_u8();
8080 __struct.bus = buf.get_u8();
8081 let tmp = buf.get_u8();
8082 __struct.operation =
8083 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8084 enum_type: "CanFilterOp",
8085 value: tmp as u32,
8086 })?;
8087 __struct.num_ids = buf.get_u8();
8088 Ok(__struct)
8089 }
8090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8091 let mut __tmp = BytesMut::new(bytes);
8092 #[allow(clippy::absurd_extreme_comparisons)]
8093 #[allow(unused_comparisons)]
8094 if __tmp.remaining() < Self::ENCODED_LEN {
8095 panic!(
8096 "buffer is too small (need {} bytes, but got {})",
8097 Self::ENCODED_LEN,
8098 __tmp.remaining(),
8099 )
8100 }
8101 for val in &self.ids {
8102 __tmp.put_u16_le(*val);
8103 }
8104 __tmp.put_u8(self.target_system);
8105 __tmp.put_u8(self.target_component);
8106 __tmp.put_u8(self.bus);
8107 __tmp.put_u8(self.operation as u8);
8108 __tmp.put_u8(self.num_ids);
8109 if matches!(version, MavlinkVersion::V2) {
8110 let len = __tmp.len();
8111 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8112 } else {
8113 __tmp.len()
8114 }
8115 }
8116}
8117#[doc = "id: 386"]
8118#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8119#[derive(Debug, Clone, PartialEq)]
8120#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8121#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8122pub struct CAN_FRAME_DATA {
8123 #[doc = "Frame ID"]
8124 pub id: u32,
8125 #[doc = "System ID."]
8126 pub target_system: u8,
8127 #[doc = "Component ID."]
8128 pub target_component: u8,
8129 #[doc = "Bus number"]
8130 pub bus: u8,
8131 #[doc = "Frame length"]
8132 pub len: u8,
8133 #[doc = "Frame data"]
8134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8135 pub data: [u8; 8],
8136}
8137impl CAN_FRAME_DATA {
8138 pub const ENCODED_LEN: usize = 16usize;
8139 pub const DEFAULT: Self = Self {
8140 id: 0_u32,
8141 target_system: 0_u8,
8142 target_component: 0_u8,
8143 bus: 0_u8,
8144 len: 0_u8,
8145 data: [0_u8; 8usize],
8146 };
8147 #[cfg(feature = "arbitrary")]
8148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8149 use arbitrary::{Arbitrary, Unstructured};
8150 let mut buf = [0u8; 1024];
8151 rng.fill_bytes(&mut buf);
8152 let mut unstructured = Unstructured::new(&buf);
8153 Self::arbitrary(&mut unstructured).unwrap_or_default()
8154 }
8155}
8156impl Default for CAN_FRAME_DATA {
8157 fn default() -> Self {
8158 Self::DEFAULT.clone()
8159 }
8160}
8161impl MessageData for CAN_FRAME_DATA {
8162 type Message = MavMessage;
8163 const ID: u32 = 386u32;
8164 const NAME: &'static str = "CAN_FRAME";
8165 const EXTRA_CRC: u8 = 132u8;
8166 const ENCODED_LEN: usize = 16usize;
8167 fn deser(
8168 _version: MavlinkVersion,
8169 __input: &[u8],
8170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8171 let avail_len = __input.len();
8172 let mut payload_buf = [0; Self::ENCODED_LEN];
8173 let mut buf = if avail_len < Self::ENCODED_LEN {
8174 payload_buf[0..avail_len].copy_from_slice(__input);
8175 Bytes::new(&payload_buf)
8176 } else {
8177 Bytes::new(__input)
8178 };
8179 let mut __struct = Self::default();
8180 __struct.id = buf.get_u32_le();
8181 __struct.target_system = buf.get_u8();
8182 __struct.target_component = buf.get_u8();
8183 __struct.bus = buf.get_u8();
8184 __struct.len = buf.get_u8();
8185 for v in &mut __struct.data {
8186 let val = buf.get_u8();
8187 *v = val;
8188 }
8189 Ok(__struct)
8190 }
8191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8192 let mut __tmp = BytesMut::new(bytes);
8193 #[allow(clippy::absurd_extreme_comparisons)]
8194 #[allow(unused_comparisons)]
8195 if __tmp.remaining() < Self::ENCODED_LEN {
8196 panic!(
8197 "buffer is too small (need {} bytes, but got {})",
8198 Self::ENCODED_LEN,
8199 __tmp.remaining(),
8200 )
8201 }
8202 __tmp.put_u32_le(self.id);
8203 __tmp.put_u8(self.target_system);
8204 __tmp.put_u8(self.target_component);
8205 __tmp.put_u8(self.bus);
8206 __tmp.put_u8(self.len);
8207 for val in &self.data {
8208 __tmp.put_u8(*val);
8209 }
8210 if matches!(version, MavlinkVersion::V2) {
8211 let len = __tmp.len();
8212 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8213 } else {
8214 __tmp.len()
8215 }
8216 }
8217}
8218#[doc = "id: 336"]
8219#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8220#[derive(Debug, Clone, PartialEq)]
8221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8223pub struct CELLULAR_CONFIG_DATA {
8224 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8225 pub enable_lte: u8,
8226 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8227 pub enable_pin: u8,
8228 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8229 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8230 pub pin: [u8; 16],
8231 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8232 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8233 pub new_pin: [u8; 16],
8234 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8235 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8236 pub apn: [u8; 32],
8237 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8238 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8239 pub puk: [u8; 16],
8240 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8241 pub roaming: u8,
8242 #[doc = "Message acceptance response (sent back to GS)."]
8243 pub response: CellularConfigResponse,
8244}
8245impl CELLULAR_CONFIG_DATA {
8246 pub const ENCODED_LEN: usize = 84usize;
8247 pub const DEFAULT: Self = Self {
8248 enable_lte: 0_u8,
8249 enable_pin: 0_u8,
8250 pin: [0_u8; 16usize],
8251 new_pin: [0_u8; 16usize],
8252 apn: [0_u8; 32usize],
8253 puk: [0_u8; 16usize],
8254 roaming: 0_u8,
8255 response: CellularConfigResponse::DEFAULT,
8256 };
8257 #[cfg(feature = "arbitrary")]
8258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8259 use arbitrary::{Arbitrary, Unstructured};
8260 let mut buf = [0u8; 1024];
8261 rng.fill_bytes(&mut buf);
8262 let mut unstructured = Unstructured::new(&buf);
8263 Self::arbitrary(&mut unstructured).unwrap_or_default()
8264 }
8265}
8266impl Default for CELLULAR_CONFIG_DATA {
8267 fn default() -> Self {
8268 Self::DEFAULT.clone()
8269 }
8270}
8271impl MessageData for CELLULAR_CONFIG_DATA {
8272 type Message = MavMessage;
8273 const ID: u32 = 336u32;
8274 const NAME: &'static str = "CELLULAR_CONFIG";
8275 const EXTRA_CRC: u8 = 245u8;
8276 const ENCODED_LEN: usize = 84usize;
8277 fn deser(
8278 _version: MavlinkVersion,
8279 __input: &[u8],
8280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8281 let avail_len = __input.len();
8282 let mut payload_buf = [0; Self::ENCODED_LEN];
8283 let mut buf = if avail_len < Self::ENCODED_LEN {
8284 payload_buf[0..avail_len].copy_from_slice(__input);
8285 Bytes::new(&payload_buf)
8286 } else {
8287 Bytes::new(__input)
8288 };
8289 let mut __struct = Self::default();
8290 __struct.enable_lte = buf.get_u8();
8291 __struct.enable_pin = buf.get_u8();
8292 for v in &mut __struct.pin {
8293 let val = buf.get_u8();
8294 *v = val;
8295 }
8296 for v in &mut __struct.new_pin {
8297 let val = buf.get_u8();
8298 *v = val;
8299 }
8300 for v in &mut __struct.apn {
8301 let val = buf.get_u8();
8302 *v = val;
8303 }
8304 for v in &mut __struct.puk {
8305 let val = buf.get_u8();
8306 *v = val;
8307 }
8308 __struct.roaming = buf.get_u8();
8309 let tmp = buf.get_u8();
8310 __struct.response =
8311 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8312 enum_type: "CellularConfigResponse",
8313 value: tmp as u32,
8314 })?;
8315 Ok(__struct)
8316 }
8317 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8318 let mut __tmp = BytesMut::new(bytes);
8319 #[allow(clippy::absurd_extreme_comparisons)]
8320 #[allow(unused_comparisons)]
8321 if __tmp.remaining() < Self::ENCODED_LEN {
8322 panic!(
8323 "buffer is too small (need {} bytes, but got {})",
8324 Self::ENCODED_LEN,
8325 __tmp.remaining(),
8326 )
8327 }
8328 __tmp.put_u8(self.enable_lte);
8329 __tmp.put_u8(self.enable_pin);
8330 for val in &self.pin {
8331 __tmp.put_u8(*val);
8332 }
8333 for val in &self.new_pin {
8334 __tmp.put_u8(*val);
8335 }
8336 for val in &self.apn {
8337 __tmp.put_u8(*val);
8338 }
8339 for val in &self.puk {
8340 __tmp.put_u8(*val);
8341 }
8342 __tmp.put_u8(self.roaming);
8343 __tmp.put_u8(self.response as u8);
8344 if matches!(version, MavlinkVersion::V2) {
8345 let len = __tmp.len();
8346 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8347 } else {
8348 __tmp.len()
8349 }
8350 }
8351}
8352#[doc = "id: 334"]
8353#[doc = "Report current used cellular network status."]
8354#[derive(Debug, Clone, PartialEq)]
8355#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8356#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8357pub struct CELLULAR_STATUS_DATA {
8358 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8359 pub mcc: u16,
8360 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8361 pub mnc: u16,
8362 #[doc = "Location area code. If unknown, set to 0"]
8363 pub lac: u16,
8364 #[doc = "Cellular modem status"]
8365 pub status: CellularStatusFlag,
8366 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8367 pub failure_reason: CellularNetworkFailedReason,
8368 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8369 pub mavtype: CellularNetworkRadioType,
8370 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8371 pub quality: u8,
8372}
8373impl CELLULAR_STATUS_DATA {
8374 pub const ENCODED_LEN: usize = 10usize;
8375 pub const DEFAULT: Self = Self {
8376 mcc: 0_u16,
8377 mnc: 0_u16,
8378 lac: 0_u16,
8379 status: CellularStatusFlag::DEFAULT,
8380 failure_reason: CellularNetworkFailedReason::DEFAULT,
8381 mavtype: CellularNetworkRadioType::DEFAULT,
8382 quality: 0_u8,
8383 };
8384 #[cfg(feature = "arbitrary")]
8385 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8386 use arbitrary::{Arbitrary, Unstructured};
8387 let mut buf = [0u8; 1024];
8388 rng.fill_bytes(&mut buf);
8389 let mut unstructured = Unstructured::new(&buf);
8390 Self::arbitrary(&mut unstructured).unwrap_or_default()
8391 }
8392}
8393impl Default for CELLULAR_STATUS_DATA {
8394 fn default() -> Self {
8395 Self::DEFAULT.clone()
8396 }
8397}
8398impl MessageData for CELLULAR_STATUS_DATA {
8399 type Message = MavMessage;
8400 const ID: u32 = 334u32;
8401 const NAME: &'static str = "CELLULAR_STATUS";
8402 const EXTRA_CRC: u8 = 72u8;
8403 const ENCODED_LEN: usize = 10usize;
8404 fn deser(
8405 _version: MavlinkVersion,
8406 __input: &[u8],
8407 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8408 let avail_len = __input.len();
8409 let mut payload_buf = [0; Self::ENCODED_LEN];
8410 let mut buf = if avail_len < Self::ENCODED_LEN {
8411 payload_buf[0..avail_len].copy_from_slice(__input);
8412 Bytes::new(&payload_buf)
8413 } else {
8414 Bytes::new(__input)
8415 };
8416 let mut __struct = Self::default();
8417 __struct.mcc = buf.get_u16_le();
8418 __struct.mnc = buf.get_u16_le();
8419 __struct.lac = buf.get_u16_le();
8420 let tmp = buf.get_u8();
8421 __struct.status =
8422 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8423 enum_type: "CellularStatusFlag",
8424 value: tmp as u32,
8425 })?;
8426 let tmp = buf.get_u8();
8427 __struct.failure_reason =
8428 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8429 enum_type: "CellularNetworkFailedReason",
8430 value: tmp as u32,
8431 })?;
8432 let tmp = buf.get_u8();
8433 __struct.mavtype =
8434 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8435 enum_type: "CellularNetworkRadioType",
8436 value: tmp as u32,
8437 })?;
8438 __struct.quality = buf.get_u8();
8439 Ok(__struct)
8440 }
8441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8442 let mut __tmp = BytesMut::new(bytes);
8443 #[allow(clippy::absurd_extreme_comparisons)]
8444 #[allow(unused_comparisons)]
8445 if __tmp.remaining() < Self::ENCODED_LEN {
8446 panic!(
8447 "buffer is too small (need {} bytes, but got {})",
8448 Self::ENCODED_LEN,
8449 __tmp.remaining(),
8450 )
8451 }
8452 __tmp.put_u16_le(self.mcc);
8453 __tmp.put_u16_le(self.mnc);
8454 __tmp.put_u16_le(self.lac);
8455 __tmp.put_u8(self.status as u8);
8456 __tmp.put_u8(self.failure_reason as u8);
8457 __tmp.put_u8(self.mavtype as u8);
8458 __tmp.put_u8(self.quality);
8459 if matches!(version, MavlinkVersion::V2) {
8460 let len = __tmp.len();
8461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8462 } else {
8463 __tmp.len()
8464 }
8465 }
8466}
8467#[doc = "id: 5"]
8468#[doc = "Request to control this MAV."]
8469#[derive(Debug, Clone, PartialEq)]
8470#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8472pub struct CHANGE_OPERATOR_CONTROL_DATA {
8473 #[doc = "System the GCS requests control for"]
8474 pub target_system: u8,
8475 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8476 pub control_request: u8,
8477 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8478 pub version: u8,
8479 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8480 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8481 pub passkey: [u8; 25],
8482}
8483impl CHANGE_OPERATOR_CONTROL_DATA {
8484 pub const ENCODED_LEN: usize = 28usize;
8485 pub const DEFAULT: Self = Self {
8486 target_system: 0_u8,
8487 control_request: 0_u8,
8488 version: 0_u8,
8489 passkey: [0_u8; 25usize],
8490 };
8491 #[cfg(feature = "arbitrary")]
8492 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8493 use arbitrary::{Arbitrary, Unstructured};
8494 let mut buf = [0u8; 1024];
8495 rng.fill_bytes(&mut buf);
8496 let mut unstructured = Unstructured::new(&buf);
8497 Self::arbitrary(&mut unstructured).unwrap_or_default()
8498 }
8499}
8500impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8501 fn default() -> Self {
8502 Self::DEFAULT.clone()
8503 }
8504}
8505impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8506 type Message = MavMessage;
8507 const ID: u32 = 5u32;
8508 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8509 const EXTRA_CRC: u8 = 217u8;
8510 const ENCODED_LEN: usize = 28usize;
8511 fn deser(
8512 _version: MavlinkVersion,
8513 __input: &[u8],
8514 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8515 let avail_len = __input.len();
8516 let mut payload_buf = [0; Self::ENCODED_LEN];
8517 let mut buf = if avail_len < Self::ENCODED_LEN {
8518 payload_buf[0..avail_len].copy_from_slice(__input);
8519 Bytes::new(&payload_buf)
8520 } else {
8521 Bytes::new(__input)
8522 };
8523 let mut __struct = Self::default();
8524 __struct.target_system = buf.get_u8();
8525 __struct.control_request = buf.get_u8();
8526 __struct.version = buf.get_u8();
8527 for v in &mut __struct.passkey {
8528 let val = buf.get_u8();
8529 *v = val;
8530 }
8531 Ok(__struct)
8532 }
8533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8534 let mut __tmp = BytesMut::new(bytes);
8535 #[allow(clippy::absurd_extreme_comparisons)]
8536 #[allow(unused_comparisons)]
8537 if __tmp.remaining() < Self::ENCODED_LEN {
8538 panic!(
8539 "buffer is too small (need {} bytes, but got {})",
8540 Self::ENCODED_LEN,
8541 __tmp.remaining(),
8542 )
8543 }
8544 __tmp.put_u8(self.target_system);
8545 __tmp.put_u8(self.control_request);
8546 __tmp.put_u8(self.version);
8547 for val in &self.passkey {
8548 __tmp.put_u8(*val);
8549 }
8550 if matches!(version, MavlinkVersion::V2) {
8551 let len = __tmp.len();
8552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8553 } else {
8554 __tmp.len()
8555 }
8556 }
8557}
8558#[doc = "id: 6"]
8559#[doc = "Accept / deny control of this MAV."]
8560#[derive(Debug, Clone, PartialEq)]
8561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8563pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8564 #[doc = "ID of the GCS this message"]
8565 pub gcs_system_id: u8,
8566 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8567 pub control_request: u8,
8568 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8569 pub ack: u8,
8570}
8571impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8572 pub const ENCODED_LEN: usize = 3usize;
8573 pub const DEFAULT: Self = Self {
8574 gcs_system_id: 0_u8,
8575 control_request: 0_u8,
8576 ack: 0_u8,
8577 };
8578 #[cfg(feature = "arbitrary")]
8579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8580 use arbitrary::{Arbitrary, Unstructured};
8581 let mut buf = [0u8; 1024];
8582 rng.fill_bytes(&mut buf);
8583 let mut unstructured = Unstructured::new(&buf);
8584 Self::arbitrary(&mut unstructured).unwrap_or_default()
8585 }
8586}
8587impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8588 fn default() -> Self {
8589 Self::DEFAULT.clone()
8590 }
8591}
8592impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8593 type Message = MavMessage;
8594 const ID: u32 = 6u32;
8595 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8596 const EXTRA_CRC: u8 = 104u8;
8597 const ENCODED_LEN: usize = 3usize;
8598 fn deser(
8599 _version: MavlinkVersion,
8600 __input: &[u8],
8601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8602 let avail_len = __input.len();
8603 let mut payload_buf = [0; Self::ENCODED_LEN];
8604 let mut buf = if avail_len < Self::ENCODED_LEN {
8605 payload_buf[0..avail_len].copy_from_slice(__input);
8606 Bytes::new(&payload_buf)
8607 } else {
8608 Bytes::new(__input)
8609 };
8610 let mut __struct = Self::default();
8611 __struct.gcs_system_id = buf.get_u8();
8612 __struct.control_request = buf.get_u8();
8613 __struct.ack = buf.get_u8();
8614 Ok(__struct)
8615 }
8616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8617 let mut __tmp = BytesMut::new(bytes);
8618 #[allow(clippy::absurd_extreme_comparisons)]
8619 #[allow(unused_comparisons)]
8620 if __tmp.remaining() < Self::ENCODED_LEN {
8621 panic!(
8622 "buffer is too small (need {} bytes, but got {})",
8623 Self::ENCODED_LEN,
8624 __tmp.remaining(),
8625 )
8626 }
8627 __tmp.put_u8(self.gcs_system_id);
8628 __tmp.put_u8(self.control_request);
8629 __tmp.put_u8(self.ack);
8630 if matches!(version, MavlinkVersion::V2) {
8631 let len = __tmp.len();
8632 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8633 } else {
8634 __tmp.len()
8635 }
8636 }
8637}
8638#[doc = "id: 247"]
8639#[doc = "Information about a potential collision."]
8640#[derive(Debug, Clone, PartialEq)]
8641#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8643pub struct COLLISION_DATA {
8644 #[doc = "Unique identifier, domain based on src field"]
8645 pub id: u32,
8646 #[doc = "Estimated time until collision occurs"]
8647 pub time_to_minimum_delta: f32,
8648 #[doc = "Closest vertical distance between vehicle and object"]
8649 pub altitude_minimum_delta: f32,
8650 #[doc = "Closest horizontal distance between vehicle and object"]
8651 pub horizontal_minimum_delta: f32,
8652 #[doc = "Collision data source"]
8653 pub src: MavCollisionSrc,
8654 #[doc = "Action that is being taken to avoid this collision"]
8655 pub action: MavCollisionAction,
8656 #[doc = "How concerned the aircraft is about this collision"]
8657 pub threat_level: MavCollisionThreatLevel,
8658}
8659impl COLLISION_DATA {
8660 pub const ENCODED_LEN: usize = 19usize;
8661 pub const DEFAULT: Self = Self {
8662 id: 0_u32,
8663 time_to_minimum_delta: 0.0_f32,
8664 altitude_minimum_delta: 0.0_f32,
8665 horizontal_minimum_delta: 0.0_f32,
8666 src: MavCollisionSrc::DEFAULT,
8667 action: MavCollisionAction::DEFAULT,
8668 threat_level: MavCollisionThreatLevel::DEFAULT,
8669 };
8670 #[cfg(feature = "arbitrary")]
8671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8672 use arbitrary::{Arbitrary, Unstructured};
8673 let mut buf = [0u8; 1024];
8674 rng.fill_bytes(&mut buf);
8675 let mut unstructured = Unstructured::new(&buf);
8676 Self::arbitrary(&mut unstructured).unwrap_or_default()
8677 }
8678}
8679impl Default for COLLISION_DATA {
8680 fn default() -> Self {
8681 Self::DEFAULT.clone()
8682 }
8683}
8684impl MessageData for COLLISION_DATA {
8685 type Message = MavMessage;
8686 const ID: u32 = 247u32;
8687 const NAME: &'static str = "COLLISION";
8688 const EXTRA_CRC: u8 = 81u8;
8689 const ENCODED_LEN: usize = 19usize;
8690 fn deser(
8691 _version: MavlinkVersion,
8692 __input: &[u8],
8693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8694 let avail_len = __input.len();
8695 let mut payload_buf = [0; Self::ENCODED_LEN];
8696 let mut buf = if avail_len < Self::ENCODED_LEN {
8697 payload_buf[0..avail_len].copy_from_slice(__input);
8698 Bytes::new(&payload_buf)
8699 } else {
8700 Bytes::new(__input)
8701 };
8702 let mut __struct = Self::default();
8703 __struct.id = buf.get_u32_le();
8704 __struct.time_to_minimum_delta = buf.get_f32_le();
8705 __struct.altitude_minimum_delta = buf.get_f32_le();
8706 __struct.horizontal_minimum_delta = buf.get_f32_le();
8707 let tmp = buf.get_u8();
8708 __struct.src =
8709 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8710 enum_type: "MavCollisionSrc",
8711 value: tmp as u32,
8712 })?;
8713 let tmp = buf.get_u8();
8714 __struct.action =
8715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8716 enum_type: "MavCollisionAction",
8717 value: tmp as u32,
8718 })?;
8719 let tmp = buf.get_u8();
8720 __struct.threat_level =
8721 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8722 enum_type: "MavCollisionThreatLevel",
8723 value: tmp as u32,
8724 })?;
8725 Ok(__struct)
8726 }
8727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8728 let mut __tmp = BytesMut::new(bytes);
8729 #[allow(clippy::absurd_extreme_comparisons)]
8730 #[allow(unused_comparisons)]
8731 if __tmp.remaining() < Self::ENCODED_LEN {
8732 panic!(
8733 "buffer is too small (need {} bytes, but got {})",
8734 Self::ENCODED_LEN,
8735 __tmp.remaining(),
8736 )
8737 }
8738 __tmp.put_u32_le(self.id);
8739 __tmp.put_f32_le(self.time_to_minimum_delta);
8740 __tmp.put_f32_le(self.altitude_minimum_delta);
8741 __tmp.put_f32_le(self.horizontal_minimum_delta);
8742 __tmp.put_u8(self.src as u8);
8743 __tmp.put_u8(self.action as u8);
8744 __tmp.put_u8(self.threat_level as u8);
8745 if matches!(version, MavlinkVersion::V2) {
8746 let len = __tmp.len();
8747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8748 } else {
8749 __tmp.len()
8750 }
8751 }
8752}
8753#[doc = "id: 77"]
8754#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8755#[derive(Debug, Clone, PartialEq)]
8756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8758pub struct COMMAND_ACK_DATA {
8759 #[doc = "Command ID (of acknowledged command)."]
8760 pub command: MavCmd,
8761 #[doc = "Result of command."]
8762 pub result: MavResult,
8763 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
8764 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8765 pub progress: u8,
8766 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
8767 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8768 pub result_param2: i32,
8769 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8770 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8771 pub target_system: u8,
8772 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
8773 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8774 pub target_component: u8,
8775}
8776impl COMMAND_ACK_DATA {
8777 pub const ENCODED_LEN: usize = 10usize;
8778 pub const DEFAULT: Self = Self {
8779 command: MavCmd::DEFAULT,
8780 result: MavResult::DEFAULT,
8781 progress: 0_u8,
8782 result_param2: 0_i32,
8783 target_system: 0_u8,
8784 target_component: 0_u8,
8785 };
8786 #[cfg(feature = "arbitrary")]
8787 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8788 use arbitrary::{Arbitrary, Unstructured};
8789 let mut buf = [0u8; 1024];
8790 rng.fill_bytes(&mut buf);
8791 let mut unstructured = Unstructured::new(&buf);
8792 Self::arbitrary(&mut unstructured).unwrap_or_default()
8793 }
8794}
8795impl Default for COMMAND_ACK_DATA {
8796 fn default() -> Self {
8797 Self::DEFAULT.clone()
8798 }
8799}
8800impl MessageData for COMMAND_ACK_DATA {
8801 type Message = MavMessage;
8802 const ID: u32 = 77u32;
8803 const NAME: &'static str = "COMMAND_ACK";
8804 const EXTRA_CRC: u8 = 143u8;
8805 const ENCODED_LEN: usize = 10usize;
8806 fn deser(
8807 _version: MavlinkVersion,
8808 __input: &[u8],
8809 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8810 let avail_len = __input.len();
8811 let mut payload_buf = [0; Self::ENCODED_LEN];
8812 let mut buf = if avail_len < Self::ENCODED_LEN {
8813 payload_buf[0..avail_len].copy_from_slice(__input);
8814 Bytes::new(&payload_buf)
8815 } else {
8816 Bytes::new(__input)
8817 };
8818 let mut __struct = Self::default();
8819 let tmp = buf.get_u16_le();
8820 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8821 ::mavlink_core::error::ParserError::InvalidEnum {
8822 enum_type: "MavCmd",
8823 value: tmp as u32,
8824 },
8825 )?;
8826 let tmp = buf.get_u8();
8827 __struct.result =
8828 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8829 enum_type: "MavResult",
8830 value: tmp as u32,
8831 })?;
8832 __struct.progress = buf.get_u8();
8833 __struct.result_param2 = buf.get_i32_le();
8834 __struct.target_system = buf.get_u8();
8835 __struct.target_component = buf.get_u8();
8836 Ok(__struct)
8837 }
8838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8839 let mut __tmp = BytesMut::new(bytes);
8840 #[allow(clippy::absurd_extreme_comparisons)]
8841 #[allow(unused_comparisons)]
8842 if __tmp.remaining() < Self::ENCODED_LEN {
8843 panic!(
8844 "buffer is too small (need {} bytes, but got {})",
8845 Self::ENCODED_LEN,
8846 __tmp.remaining(),
8847 )
8848 }
8849 __tmp.put_u16_le(self.command as u16);
8850 __tmp.put_u8(self.result as u8);
8851 __tmp.put_u8(self.progress);
8852 __tmp.put_i32_le(self.result_param2);
8853 __tmp.put_u8(self.target_system);
8854 __tmp.put_u8(self.target_component);
8855 if matches!(version, MavlinkVersion::V2) {
8856 let len = __tmp.len();
8857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8858 } else {
8859 __tmp.len()
8860 }
8861 }
8862}
8863#[doc = "id: 80"]
8864#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8865#[derive(Debug, Clone, PartialEq)]
8866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8868pub struct COMMAND_CANCEL_DATA {
8869 #[doc = "Command ID (of command to cancel)."]
8870 pub command: MavCmd,
8871 #[doc = "System executing long running command. Should not be broadcast (0)."]
8872 pub target_system: u8,
8873 #[doc = "Component executing long running command."]
8874 pub target_component: u8,
8875}
8876impl COMMAND_CANCEL_DATA {
8877 pub const ENCODED_LEN: usize = 4usize;
8878 pub const DEFAULT: Self = Self {
8879 command: MavCmd::DEFAULT,
8880 target_system: 0_u8,
8881 target_component: 0_u8,
8882 };
8883 #[cfg(feature = "arbitrary")]
8884 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8885 use arbitrary::{Arbitrary, Unstructured};
8886 let mut buf = [0u8; 1024];
8887 rng.fill_bytes(&mut buf);
8888 let mut unstructured = Unstructured::new(&buf);
8889 Self::arbitrary(&mut unstructured).unwrap_or_default()
8890 }
8891}
8892impl Default for COMMAND_CANCEL_DATA {
8893 fn default() -> Self {
8894 Self::DEFAULT.clone()
8895 }
8896}
8897impl MessageData for COMMAND_CANCEL_DATA {
8898 type Message = MavMessage;
8899 const ID: u32 = 80u32;
8900 const NAME: &'static str = "COMMAND_CANCEL";
8901 const EXTRA_CRC: u8 = 14u8;
8902 const ENCODED_LEN: usize = 4usize;
8903 fn deser(
8904 _version: MavlinkVersion,
8905 __input: &[u8],
8906 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8907 let avail_len = __input.len();
8908 let mut payload_buf = [0; Self::ENCODED_LEN];
8909 let mut buf = if avail_len < Self::ENCODED_LEN {
8910 payload_buf[0..avail_len].copy_from_slice(__input);
8911 Bytes::new(&payload_buf)
8912 } else {
8913 Bytes::new(__input)
8914 };
8915 let mut __struct = Self::default();
8916 let tmp = buf.get_u16_le();
8917 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8918 ::mavlink_core::error::ParserError::InvalidEnum {
8919 enum_type: "MavCmd",
8920 value: tmp as u32,
8921 },
8922 )?;
8923 __struct.target_system = buf.get_u8();
8924 __struct.target_component = buf.get_u8();
8925 Ok(__struct)
8926 }
8927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8928 let mut __tmp = BytesMut::new(bytes);
8929 #[allow(clippy::absurd_extreme_comparisons)]
8930 #[allow(unused_comparisons)]
8931 if __tmp.remaining() < Self::ENCODED_LEN {
8932 panic!(
8933 "buffer is too small (need {} bytes, but got {})",
8934 Self::ENCODED_LEN,
8935 __tmp.remaining(),
8936 )
8937 }
8938 __tmp.put_u16_le(self.command as u16);
8939 __tmp.put_u8(self.target_system);
8940 __tmp.put_u8(self.target_component);
8941 if matches!(version, MavlinkVersion::V2) {
8942 let len = __tmp.len();
8943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8944 } else {
8945 __tmp.len()
8946 }
8947 }
8948}
8949#[doc = "id: 75"]
8950#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
8951#[derive(Debug, Clone, PartialEq)]
8952#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8953#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8954pub struct COMMAND_INT_DATA {
8955 #[doc = "PARAM1, see MAV_CMD enum"]
8956 pub param1: f32,
8957 #[doc = "PARAM2, see MAV_CMD enum"]
8958 pub param2: f32,
8959 #[doc = "PARAM3, see MAV_CMD enum"]
8960 pub param3: f32,
8961 #[doc = "PARAM4, see MAV_CMD enum"]
8962 pub param4: f32,
8963 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8964 pub x: i32,
8965 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
8966 pub y: i32,
8967 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
8968 pub z: f32,
8969 #[doc = "The scheduled action for the mission item."]
8970 pub command: MavCmd,
8971 #[doc = "System ID"]
8972 pub target_system: u8,
8973 #[doc = "Component ID"]
8974 pub target_component: u8,
8975 #[doc = "The coordinate system of the COMMAND."]
8976 pub frame: MavFrame,
8977 #[doc = "Not used."]
8978 pub current: u8,
8979 #[doc = "Not used (set 0)."]
8980 pub autocontinue: u8,
8981}
8982impl COMMAND_INT_DATA {
8983 pub const ENCODED_LEN: usize = 35usize;
8984 pub const DEFAULT: Self = Self {
8985 param1: 0.0_f32,
8986 param2: 0.0_f32,
8987 param3: 0.0_f32,
8988 param4: 0.0_f32,
8989 x: 0_i32,
8990 y: 0_i32,
8991 z: 0.0_f32,
8992 command: MavCmd::DEFAULT,
8993 target_system: 0_u8,
8994 target_component: 0_u8,
8995 frame: MavFrame::DEFAULT,
8996 current: 0_u8,
8997 autocontinue: 0_u8,
8998 };
8999 #[cfg(feature = "arbitrary")]
9000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9001 use arbitrary::{Arbitrary, Unstructured};
9002 let mut buf = [0u8; 1024];
9003 rng.fill_bytes(&mut buf);
9004 let mut unstructured = Unstructured::new(&buf);
9005 Self::arbitrary(&mut unstructured).unwrap_or_default()
9006 }
9007}
9008impl Default for COMMAND_INT_DATA {
9009 fn default() -> Self {
9010 Self::DEFAULT.clone()
9011 }
9012}
9013impl MessageData for COMMAND_INT_DATA {
9014 type Message = MavMessage;
9015 const ID: u32 = 75u32;
9016 const NAME: &'static str = "COMMAND_INT";
9017 const EXTRA_CRC: u8 = 158u8;
9018 const ENCODED_LEN: usize = 35usize;
9019 fn deser(
9020 _version: MavlinkVersion,
9021 __input: &[u8],
9022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9023 let avail_len = __input.len();
9024 let mut payload_buf = [0; Self::ENCODED_LEN];
9025 let mut buf = if avail_len < Self::ENCODED_LEN {
9026 payload_buf[0..avail_len].copy_from_slice(__input);
9027 Bytes::new(&payload_buf)
9028 } else {
9029 Bytes::new(__input)
9030 };
9031 let mut __struct = Self::default();
9032 __struct.param1 = buf.get_f32_le();
9033 __struct.param2 = buf.get_f32_le();
9034 __struct.param3 = buf.get_f32_le();
9035 __struct.param4 = buf.get_f32_le();
9036 __struct.x = buf.get_i32_le();
9037 __struct.y = buf.get_i32_le();
9038 __struct.z = buf.get_f32_le();
9039 let tmp = buf.get_u16_le();
9040 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9041 ::mavlink_core::error::ParserError::InvalidEnum {
9042 enum_type: "MavCmd",
9043 value: tmp as u32,
9044 },
9045 )?;
9046 __struct.target_system = buf.get_u8();
9047 __struct.target_component = buf.get_u8();
9048 let tmp = buf.get_u8();
9049 __struct.frame =
9050 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9051 enum_type: "MavFrame",
9052 value: tmp as u32,
9053 })?;
9054 __struct.current = buf.get_u8();
9055 __struct.autocontinue = buf.get_u8();
9056 Ok(__struct)
9057 }
9058 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9059 let mut __tmp = BytesMut::new(bytes);
9060 #[allow(clippy::absurd_extreme_comparisons)]
9061 #[allow(unused_comparisons)]
9062 if __tmp.remaining() < Self::ENCODED_LEN {
9063 panic!(
9064 "buffer is too small (need {} bytes, but got {})",
9065 Self::ENCODED_LEN,
9066 __tmp.remaining(),
9067 )
9068 }
9069 __tmp.put_f32_le(self.param1);
9070 __tmp.put_f32_le(self.param2);
9071 __tmp.put_f32_le(self.param3);
9072 __tmp.put_f32_le(self.param4);
9073 __tmp.put_i32_le(self.x);
9074 __tmp.put_i32_le(self.y);
9075 __tmp.put_f32_le(self.z);
9076 __tmp.put_u16_le(self.command as u16);
9077 __tmp.put_u8(self.target_system);
9078 __tmp.put_u8(self.target_component);
9079 __tmp.put_u8(self.frame as u8);
9080 __tmp.put_u8(self.current);
9081 __tmp.put_u8(self.autocontinue);
9082 if matches!(version, MavlinkVersion::V2) {
9083 let len = __tmp.len();
9084 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9085 } else {
9086 __tmp.len()
9087 }
9088 }
9089}
9090#[doc = "id: 76"]
9091#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9092#[derive(Debug, Clone, PartialEq)]
9093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9095pub struct COMMAND_LONG_DATA {
9096 #[doc = "Parameter 1 (for the specific command)."]
9097 pub param1: f32,
9098 #[doc = "Parameter 2 (for the specific command)."]
9099 pub param2: f32,
9100 #[doc = "Parameter 3 (for the specific command)."]
9101 pub param3: f32,
9102 #[doc = "Parameter 4 (for the specific command)."]
9103 pub param4: f32,
9104 #[doc = "Parameter 5 (for the specific command)."]
9105 pub param5: f32,
9106 #[doc = "Parameter 6 (for the specific command)."]
9107 pub param6: f32,
9108 #[doc = "Parameter 7 (for the specific command)."]
9109 pub param7: f32,
9110 #[doc = "Command ID (of command to send)."]
9111 pub command: MavCmd,
9112 #[doc = "System which should execute the command"]
9113 pub target_system: u8,
9114 #[doc = "Component which should execute the command, 0 for all components"]
9115 pub target_component: u8,
9116 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9117 pub confirmation: u8,
9118}
9119impl COMMAND_LONG_DATA {
9120 pub const ENCODED_LEN: usize = 33usize;
9121 pub const DEFAULT: Self = Self {
9122 param1: 0.0_f32,
9123 param2: 0.0_f32,
9124 param3: 0.0_f32,
9125 param4: 0.0_f32,
9126 param5: 0.0_f32,
9127 param6: 0.0_f32,
9128 param7: 0.0_f32,
9129 command: MavCmd::DEFAULT,
9130 target_system: 0_u8,
9131 target_component: 0_u8,
9132 confirmation: 0_u8,
9133 };
9134 #[cfg(feature = "arbitrary")]
9135 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9136 use arbitrary::{Arbitrary, Unstructured};
9137 let mut buf = [0u8; 1024];
9138 rng.fill_bytes(&mut buf);
9139 let mut unstructured = Unstructured::new(&buf);
9140 Self::arbitrary(&mut unstructured).unwrap_or_default()
9141 }
9142}
9143impl Default for COMMAND_LONG_DATA {
9144 fn default() -> Self {
9145 Self::DEFAULT.clone()
9146 }
9147}
9148impl MessageData for COMMAND_LONG_DATA {
9149 type Message = MavMessage;
9150 const ID: u32 = 76u32;
9151 const NAME: &'static str = "COMMAND_LONG";
9152 const EXTRA_CRC: u8 = 152u8;
9153 const ENCODED_LEN: usize = 33usize;
9154 fn deser(
9155 _version: MavlinkVersion,
9156 __input: &[u8],
9157 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9158 let avail_len = __input.len();
9159 let mut payload_buf = [0; Self::ENCODED_LEN];
9160 let mut buf = if avail_len < Self::ENCODED_LEN {
9161 payload_buf[0..avail_len].copy_from_slice(__input);
9162 Bytes::new(&payload_buf)
9163 } else {
9164 Bytes::new(__input)
9165 };
9166 let mut __struct = Self::default();
9167 __struct.param1 = buf.get_f32_le();
9168 __struct.param2 = buf.get_f32_le();
9169 __struct.param3 = buf.get_f32_le();
9170 __struct.param4 = buf.get_f32_le();
9171 __struct.param5 = buf.get_f32_le();
9172 __struct.param6 = buf.get_f32_le();
9173 __struct.param7 = buf.get_f32_le();
9174 let tmp = buf.get_u16_le();
9175 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9176 ::mavlink_core::error::ParserError::InvalidEnum {
9177 enum_type: "MavCmd",
9178 value: tmp as u32,
9179 },
9180 )?;
9181 __struct.target_system = buf.get_u8();
9182 __struct.target_component = buf.get_u8();
9183 __struct.confirmation = buf.get_u8();
9184 Ok(__struct)
9185 }
9186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9187 let mut __tmp = BytesMut::new(bytes);
9188 #[allow(clippy::absurd_extreme_comparisons)]
9189 #[allow(unused_comparisons)]
9190 if __tmp.remaining() < Self::ENCODED_LEN {
9191 panic!(
9192 "buffer is too small (need {} bytes, but got {})",
9193 Self::ENCODED_LEN,
9194 __tmp.remaining(),
9195 )
9196 }
9197 __tmp.put_f32_le(self.param1);
9198 __tmp.put_f32_le(self.param2);
9199 __tmp.put_f32_le(self.param3);
9200 __tmp.put_f32_le(self.param4);
9201 __tmp.put_f32_le(self.param5);
9202 __tmp.put_f32_le(self.param6);
9203 __tmp.put_f32_le(self.param7);
9204 __tmp.put_u16_le(self.command as u16);
9205 __tmp.put_u8(self.target_system);
9206 __tmp.put_u8(self.target_component);
9207 __tmp.put_u8(self.confirmation);
9208 if matches!(version, MavlinkVersion::V2) {
9209 let len = __tmp.len();
9210 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9211 } else {
9212 __tmp.len()
9213 }
9214 }
9215}
9216#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9217#[doc = "id: 395"]
9218#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9219#[derive(Debug, Clone, PartialEq)]
9220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9222pub struct COMPONENT_INFORMATION_DATA {
9223 #[doc = "Timestamp (time since system boot)."]
9224 pub time_boot_ms: u32,
9225 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9226 pub general_metadata_file_crc: u32,
9227 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9228 pub peripherals_metadata_file_crc: u32,
9229 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9230 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9231 pub general_metadata_uri: [u8; 100],
9232 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9233 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9234 pub peripherals_metadata_uri: [u8; 100],
9235}
9236impl COMPONENT_INFORMATION_DATA {
9237 pub const ENCODED_LEN: usize = 212usize;
9238 pub const DEFAULT: Self = Self {
9239 time_boot_ms: 0_u32,
9240 general_metadata_file_crc: 0_u32,
9241 peripherals_metadata_file_crc: 0_u32,
9242 general_metadata_uri: [0_u8; 100usize],
9243 peripherals_metadata_uri: [0_u8; 100usize],
9244 };
9245 #[cfg(feature = "arbitrary")]
9246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9247 use arbitrary::{Arbitrary, Unstructured};
9248 let mut buf = [0u8; 1024];
9249 rng.fill_bytes(&mut buf);
9250 let mut unstructured = Unstructured::new(&buf);
9251 Self::arbitrary(&mut unstructured).unwrap_or_default()
9252 }
9253}
9254impl Default for COMPONENT_INFORMATION_DATA {
9255 fn default() -> Self {
9256 Self::DEFAULT.clone()
9257 }
9258}
9259impl MessageData for COMPONENT_INFORMATION_DATA {
9260 type Message = MavMessage;
9261 const ID: u32 = 395u32;
9262 const NAME: &'static str = "COMPONENT_INFORMATION";
9263 const EXTRA_CRC: u8 = 0u8;
9264 const ENCODED_LEN: usize = 212usize;
9265 fn deser(
9266 _version: MavlinkVersion,
9267 __input: &[u8],
9268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9269 let avail_len = __input.len();
9270 let mut payload_buf = [0; Self::ENCODED_LEN];
9271 let mut buf = if avail_len < Self::ENCODED_LEN {
9272 payload_buf[0..avail_len].copy_from_slice(__input);
9273 Bytes::new(&payload_buf)
9274 } else {
9275 Bytes::new(__input)
9276 };
9277 let mut __struct = Self::default();
9278 __struct.time_boot_ms = buf.get_u32_le();
9279 __struct.general_metadata_file_crc = buf.get_u32_le();
9280 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9281 for v in &mut __struct.general_metadata_uri {
9282 let val = buf.get_u8();
9283 *v = val;
9284 }
9285 for v in &mut __struct.peripherals_metadata_uri {
9286 let val = buf.get_u8();
9287 *v = val;
9288 }
9289 Ok(__struct)
9290 }
9291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9292 let mut __tmp = BytesMut::new(bytes);
9293 #[allow(clippy::absurd_extreme_comparisons)]
9294 #[allow(unused_comparisons)]
9295 if __tmp.remaining() < Self::ENCODED_LEN {
9296 panic!(
9297 "buffer is too small (need {} bytes, but got {})",
9298 Self::ENCODED_LEN,
9299 __tmp.remaining(),
9300 )
9301 }
9302 __tmp.put_u32_le(self.time_boot_ms);
9303 __tmp.put_u32_le(self.general_metadata_file_crc);
9304 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9305 for val in &self.general_metadata_uri {
9306 __tmp.put_u8(*val);
9307 }
9308 for val in &self.peripherals_metadata_uri {
9309 __tmp.put_u8(*val);
9310 }
9311 if matches!(version, MavlinkVersion::V2) {
9312 let len = __tmp.len();
9313 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9314 } else {
9315 __tmp.len()
9316 }
9317 }
9318}
9319#[doc = "id: 396"]
9320#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9321#[derive(Debug, Clone, PartialEq)]
9322#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9323#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9324pub struct COMPONENT_INFORMATION_BASIC_DATA {
9325 #[doc = "Component capability flags"]
9326 pub capabilities: MavProtocolCapability,
9327 #[doc = "Timestamp (time since system boot)."]
9328 pub time_boot_ms: u32,
9329 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9330 pub time_manufacture_s: u32,
9331 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9332 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9333 pub vendor_name: [u8; 32],
9334 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9335 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9336 pub model_name: [u8; 32],
9337 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9338 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9339 pub software_version: [u8; 24],
9340 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9341 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9342 pub hardware_version: [u8; 24],
9343 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9344 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9345 pub serial_number: [u8; 32],
9346}
9347impl COMPONENT_INFORMATION_BASIC_DATA {
9348 pub const ENCODED_LEN: usize = 160usize;
9349 pub const DEFAULT: Self = Self {
9350 capabilities: MavProtocolCapability::DEFAULT,
9351 time_boot_ms: 0_u32,
9352 time_manufacture_s: 0_u32,
9353 vendor_name: [0_u8; 32usize],
9354 model_name: [0_u8; 32usize],
9355 software_version: [0_u8; 24usize],
9356 hardware_version: [0_u8; 24usize],
9357 serial_number: [0_u8; 32usize],
9358 };
9359 #[cfg(feature = "arbitrary")]
9360 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9361 use arbitrary::{Arbitrary, Unstructured};
9362 let mut buf = [0u8; 1024];
9363 rng.fill_bytes(&mut buf);
9364 let mut unstructured = Unstructured::new(&buf);
9365 Self::arbitrary(&mut unstructured).unwrap_or_default()
9366 }
9367}
9368impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9369 fn default() -> Self {
9370 Self::DEFAULT.clone()
9371 }
9372}
9373impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9374 type Message = MavMessage;
9375 const ID: u32 = 396u32;
9376 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9377 const EXTRA_CRC: u8 = 50u8;
9378 const ENCODED_LEN: usize = 160usize;
9379 fn deser(
9380 _version: MavlinkVersion,
9381 __input: &[u8],
9382 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9383 let avail_len = __input.len();
9384 let mut payload_buf = [0; Self::ENCODED_LEN];
9385 let mut buf = if avail_len < Self::ENCODED_LEN {
9386 payload_buf[0..avail_len].copy_from_slice(__input);
9387 Bytes::new(&payload_buf)
9388 } else {
9389 Bytes::new(__input)
9390 };
9391 let mut __struct = Self::default();
9392 let tmp = buf.get_u64_le();
9393 __struct.capabilities = MavProtocolCapability::from_bits(
9394 tmp & MavProtocolCapability::all().bits(),
9395 )
9396 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9397 flag_type: "MavProtocolCapability",
9398 value: tmp as u32,
9399 })?;
9400 __struct.time_boot_ms = buf.get_u32_le();
9401 __struct.time_manufacture_s = buf.get_u32_le();
9402 for v in &mut __struct.vendor_name {
9403 let val = buf.get_u8();
9404 *v = val;
9405 }
9406 for v in &mut __struct.model_name {
9407 let val = buf.get_u8();
9408 *v = val;
9409 }
9410 for v in &mut __struct.software_version {
9411 let val = buf.get_u8();
9412 *v = val;
9413 }
9414 for v in &mut __struct.hardware_version {
9415 let val = buf.get_u8();
9416 *v = val;
9417 }
9418 for v in &mut __struct.serial_number {
9419 let val = buf.get_u8();
9420 *v = val;
9421 }
9422 Ok(__struct)
9423 }
9424 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9425 let mut __tmp = BytesMut::new(bytes);
9426 #[allow(clippy::absurd_extreme_comparisons)]
9427 #[allow(unused_comparisons)]
9428 if __tmp.remaining() < Self::ENCODED_LEN {
9429 panic!(
9430 "buffer is too small (need {} bytes, but got {})",
9431 Self::ENCODED_LEN,
9432 __tmp.remaining(),
9433 )
9434 }
9435 __tmp.put_u64_le(self.capabilities.bits());
9436 __tmp.put_u32_le(self.time_boot_ms);
9437 __tmp.put_u32_le(self.time_manufacture_s);
9438 for val in &self.vendor_name {
9439 __tmp.put_u8(*val);
9440 }
9441 for val in &self.model_name {
9442 __tmp.put_u8(*val);
9443 }
9444 for val in &self.software_version {
9445 __tmp.put_u8(*val);
9446 }
9447 for val in &self.hardware_version {
9448 __tmp.put_u8(*val);
9449 }
9450 for val in &self.serial_number {
9451 __tmp.put_u8(*val);
9452 }
9453 if matches!(version, MavlinkVersion::V2) {
9454 let len = __tmp.len();
9455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9456 } else {
9457 __tmp.len()
9458 }
9459 }
9460}
9461#[doc = "id: 397"]
9462#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9463#[derive(Debug, Clone, PartialEq)]
9464#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9465#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9466pub struct COMPONENT_METADATA_DATA {
9467 #[doc = "Timestamp (time since system boot)."]
9468 pub time_boot_ms: u32,
9469 #[doc = "CRC32 of the general metadata file."]
9470 pub file_crc: u32,
9471 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9472 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9473 pub uri: [u8; 100],
9474}
9475impl COMPONENT_METADATA_DATA {
9476 pub const ENCODED_LEN: usize = 108usize;
9477 pub const DEFAULT: Self = Self {
9478 time_boot_ms: 0_u32,
9479 file_crc: 0_u32,
9480 uri: [0_u8; 100usize],
9481 };
9482 #[cfg(feature = "arbitrary")]
9483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9484 use arbitrary::{Arbitrary, Unstructured};
9485 let mut buf = [0u8; 1024];
9486 rng.fill_bytes(&mut buf);
9487 let mut unstructured = Unstructured::new(&buf);
9488 Self::arbitrary(&mut unstructured).unwrap_or_default()
9489 }
9490}
9491impl Default for COMPONENT_METADATA_DATA {
9492 fn default() -> Self {
9493 Self::DEFAULT.clone()
9494 }
9495}
9496impl MessageData for COMPONENT_METADATA_DATA {
9497 type Message = MavMessage;
9498 const ID: u32 = 397u32;
9499 const NAME: &'static str = "COMPONENT_METADATA";
9500 const EXTRA_CRC: u8 = 182u8;
9501 const ENCODED_LEN: usize = 108usize;
9502 fn deser(
9503 _version: MavlinkVersion,
9504 __input: &[u8],
9505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9506 let avail_len = __input.len();
9507 let mut payload_buf = [0; Self::ENCODED_LEN];
9508 let mut buf = if avail_len < Self::ENCODED_LEN {
9509 payload_buf[0..avail_len].copy_from_slice(__input);
9510 Bytes::new(&payload_buf)
9511 } else {
9512 Bytes::new(__input)
9513 };
9514 let mut __struct = Self::default();
9515 __struct.time_boot_ms = buf.get_u32_le();
9516 __struct.file_crc = buf.get_u32_le();
9517 for v in &mut __struct.uri {
9518 let val = buf.get_u8();
9519 *v = val;
9520 }
9521 Ok(__struct)
9522 }
9523 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9524 let mut __tmp = BytesMut::new(bytes);
9525 #[allow(clippy::absurd_extreme_comparisons)]
9526 #[allow(unused_comparisons)]
9527 if __tmp.remaining() < Self::ENCODED_LEN {
9528 panic!(
9529 "buffer is too small (need {} bytes, but got {})",
9530 Self::ENCODED_LEN,
9531 __tmp.remaining(),
9532 )
9533 }
9534 __tmp.put_u32_le(self.time_boot_ms);
9535 __tmp.put_u32_le(self.file_crc);
9536 for val in &self.uri {
9537 __tmp.put_u8(*val);
9538 }
9539 if matches!(version, MavlinkVersion::V2) {
9540 let len = __tmp.len();
9541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9542 } else {
9543 __tmp.len()
9544 }
9545 }
9546}
9547#[doc = "id: 146"]
9548#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9549#[derive(Debug, Clone, PartialEq)]
9550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9552pub struct CONTROL_SYSTEM_STATE_DATA {
9553 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9554 pub time_usec: u64,
9555 #[doc = "X acceleration in body frame"]
9556 pub x_acc: f32,
9557 #[doc = "Y acceleration in body frame"]
9558 pub y_acc: f32,
9559 #[doc = "Z acceleration in body frame"]
9560 pub z_acc: f32,
9561 #[doc = "X velocity in body frame"]
9562 pub x_vel: f32,
9563 #[doc = "Y velocity in body frame"]
9564 pub y_vel: f32,
9565 #[doc = "Z velocity in body frame"]
9566 pub z_vel: f32,
9567 #[doc = "X position in local frame"]
9568 pub x_pos: f32,
9569 #[doc = "Y position in local frame"]
9570 pub y_pos: f32,
9571 #[doc = "Z position in local frame"]
9572 pub z_pos: f32,
9573 #[doc = "Airspeed, set to -1 if unknown"]
9574 pub airspeed: f32,
9575 #[doc = "Variance of body velocity estimate"]
9576 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9577 pub vel_variance: [f32; 3],
9578 #[doc = "Variance in local position"]
9579 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9580 pub pos_variance: [f32; 3],
9581 #[doc = "The attitude, represented as Quaternion"]
9582 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9583 pub q: [f32; 4],
9584 #[doc = "Angular rate in roll axis"]
9585 pub roll_rate: f32,
9586 #[doc = "Angular rate in pitch axis"]
9587 pub pitch_rate: f32,
9588 #[doc = "Angular rate in yaw axis"]
9589 pub yaw_rate: f32,
9590}
9591impl CONTROL_SYSTEM_STATE_DATA {
9592 pub const ENCODED_LEN: usize = 100usize;
9593 pub const DEFAULT: Self = Self {
9594 time_usec: 0_u64,
9595 x_acc: 0.0_f32,
9596 y_acc: 0.0_f32,
9597 z_acc: 0.0_f32,
9598 x_vel: 0.0_f32,
9599 y_vel: 0.0_f32,
9600 z_vel: 0.0_f32,
9601 x_pos: 0.0_f32,
9602 y_pos: 0.0_f32,
9603 z_pos: 0.0_f32,
9604 airspeed: 0.0_f32,
9605 vel_variance: [0.0_f32; 3usize],
9606 pos_variance: [0.0_f32; 3usize],
9607 q: [0.0_f32; 4usize],
9608 roll_rate: 0.0_f32,
9609 pitch_rate: 0.0_f32,
9610 yaw_rate: 0.0_f32,
9611 };
9612 #[cfg(feature = "arbitrary")]
9613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9614 use arbitrary::{Arbitrary, Unstructured};
9615 let mut buf = [0u8; 1024];
9616 rng.fill_bytes(&mut buf);
9617 let mut unstructured = Unstructured::new(&buf);
9618 Self::arbitrary(&mut unstructured).unwrap_or_default()
9619 }
9620}
9621impl Default for CONTROL_SYSTEM_STATE_DATA {
9622 fn default() -> Self {
9623 Self::DEFAULT.clone()
9624 }
9625}
9626impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9627 type Message = MavMessage;
9628 const ID: u32 = 146u32;
9629 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9630 const EXTRA_CRC: u8 = 103u8;
9631 const ENCODED_LEN: usize = 100usize;
9632 fn deser(
9633 _version: MavlinkVersion,
9634 __input: &[u8],
9635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9636 let avail_len = __input.len();
9637 let mut payload_buf = [0; Self::ENCODED_LEN];
9638 let mut buf = if avail_len < Self::ENCODED_LEN {
9639 payload_buf[0..avail_len].copy_from_slice(__input);
9640 Bytes::new(&payload_buf)
9641 } else {
9642 Bytes::new(__input)
9643 };
9644 let mut __struct = Self::default();
9645 __struct.time_usec = buf.get_u64_le();
9646 __struct.x_acc = buf.get_f32_le();
9647 __struct.y_acc = buf.get_f32_le();
9648 __struct.z_acc = buf.get_f32_le();
9649 __struct.x_vel = buf.get_f32_le();
9650 __struct.y_vel = buf.get_f32_le();
9651 __struct.z_vel = buf.get_f32_le();
9652 __struct.x_pos = buf.get_f32_le();
9653 __struct.y_pos = buf.get_f32_le();
9654 __struct.z_pos = buf.get_f32_le();
9655 __struct.airspeed = buf.get_f32_le();
9656 for v in &mut __struct.vel_variance {
9657 let val = buf.get_f32_le();
9658 *v = val;
9659 }
9660 for v in &mut __struct.pos_variance {
9661 let val = buf.get_f32_le();
9662 *v = val;
9663 }
9664 for v in &mut __struct.q {
9665 let val = buf.get_f32_le();
9666 *v = val;
9667 }
9668 __struct.roll_rate = buf.get_f32_le();
9669 __struct.pitch_rate = buf.get_f32_le();
9670 __struct.yaw_rate = buf.get_f32_le();
9671 Ok(__struct)
9672 }
9673 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9674 let mut __tmp = BytesMut::new(bytes);
9675 #[allow(clippy::absurd_extreme_comparisons)]
9676 #[allow(unused_comparisons)]
9677 if __tmp.remaining() < Self::ENCODED_LEN {
9678 panic!(
9679 "buffer is too small (need {} bytes, but got {})",
9680 Self::ENCODED_LEN,
9681 __tmp.remaining(),
9682 )
9683 }
9684 __tmp.put_u64_le(self.time_usec);
9685 __tmp.put_f32_le(self.x_acc);
9686 __tmp.put_f32_le(self.y_acc);
9687 __tmp.put_f32_le(self.z_acc);
9688 __tmp.put_f32_le(self.x_vel);
9689 __tmp.put_f32_le(self.y_vel);
9690 __tmp.put_f32_le(self.z_vel);
9691 __tmp.put_f32_le(self.x_pos);
9692 __tmp.put_f32_le(self.y_pos);
9693 __tmp.put_f32_le(self.z_pos);
9694 __tmp.put_f32_le(self.airspeed);
9695 for val in &self.vel_variance {
9696 __tmp.put_f32_le(*val);
9697 }
9698 for val in &self.pos_variance {
9699 __tmp.put_f32_le(*val);
9700 }
9701 for val in &self.q {
9702 __tmp.put_f32_le(*val);
9703 }
9704 __tmp.put_f32_le(self.roll_rate);
9705 __tmp.put_f32_le(self.pitch_rate);
9706 __tmp.put_f32_le(self.yaw_rate);
9707 if matches!(version, MavlinkVersion::V2) {
9708 let len = __tmp.len();
9709 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9710 } else {
9711 __tmp.len()
9712 }
9713 }
9714}
9715#[doc = "id: 411"]
9716#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
9717#[derive(Debug, Clone, PartialEq)]
9718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9720pub struct CURRENT_EVENT_SEQUENCE_DATA {
9721 #[doc = "Sequence number."]
9722 pub sequence: u16,
9723 #[doc = "Flag bitset."]
9724 pub flags: MavEventCurrentSequenceFlags,
9725}
9726impl CURRENT_EVENT_SEQUENCE_DATA {
9727 pub const ENCODED_LEN: usize = 3usize;
9728 pub const DEFAULT: Self = Self {
9729 sequence: 0_u16,
9730 flags: MavEventCurrentSequenceFlags::DEFAULT,
9731 };
9732 #[cfg(feature = "arbitrary")]
9733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9734 use arbitrary::{Arbitrary, Unstructured};
9735 let mut buf = [0u8; 1024];
9736 rng.fill_bytes(&mut buf);
9737 let mut unstructured = Unstructured::new(&buf);
9738 Self::arbitrary(&mut unstructured).unwrap_or_default()
9739 }
9740}
9741impl Default for CURRENT_EVENT_SEQUENCE_DATA {
9742 fn default() -> Self {
9743 Self::DEFAULT.clone()
9744 }
9745}
9746impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
9747 type Message = MavMessage;
9748 const ID: u32 = 411u32;
9749 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
9750 const EXTRA_CRC: u8 = 106u8;
9751 const ENCODED_LEN: usize = 3usize;
9752 fn deser(
9753 _version: MavlinkVersion,
9754 __input: &[u8],
9755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9756 let avail_len = __input.len();
9757 let mut payload_buf = [0; Self::ENCODED_LEN];
9758 let mut buf = if avail_len < Self::ENCODED_LEN {
9759 payload_buf[0..avail_len].copy_from_slice(__input);
9760 Bytes::new(&payload_buf)
9761 } else {
9762 Bytes::new(__input)
9763 };
9764 let mut __struct = Self::default();
9765 __struct.sequence = buf.get_u16_le();
9766 let tmp = buf.get_u8();
9767 __struct.flags =
9768 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9769 enum_type: "MavEventCurrentSequenceFlags",
9770 value: tmp as u32,
9771 })?;
9772 Ok(__struct)
9773 }
9774 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9775 let mut __tmp = BytesMut::new(bytes);
9776 #[allow(clippy::absurd_extreme_comparisons)]
9777 #[allow(unused_comparisons)]
9778 if __tmp.remaining() < Self::ENCODED_LEN {
9779 panic!(
9780 "buffer is too small (need {} bytes, but got {})",
9781 Self::ENCODED_LEN,
9782 __tmp.remaining(),
9783 )
9784 }
9785 __tmp.put_u16_le(self.sequence);
9786 __tmp.put_u8(self.flags as u8);
9787 if matches!(version, MavlinkVersion::V2) {
9788 let len = __tmp.len();
9789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9790 } else {
9791 __tmp.len()
9792 }
9793 }
9794}
9795#[doc = "id: 436"]
9796#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
9797#[derive(Debug, Clone, PartialEq)]
9798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9799#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9800pub struct CURRENT_MODE_DATA {
9801 #[doc = "A bitfield for use for autopilot-specific flags"]
9802 pub custom_mode: u32,
9803 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
9804 pub intended_custom_mode: u32,
9805 #[doc = "Standard mode."]
9806 pub standard_mode: MavStandardMode,
9807}
9808impl CURRENT_MODE_DATA {
9809 pub const ENCODED_LEN: usize = 9usize;
9810 pub const DEFAULT: Self = Self {
9811 custom_mode: 0_u32,
9812 intended_custom_mode: 0_u32,
9813 standard_mode: MavStandardMode::DEFAULT,
9814 };
9815 #[cfg(feature = "arbitrary")]
9816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9817 use arbitrary::{Arbitrary, Unstructured};
9818 let mut buf = [0u8; 1024];
9819 rng.fill_bytes(&mut buf);
9820 let mut unstructured = Unstructured::new(&buf);
9821 Self::arbitrary(&mut unstructured).unwrap_or_default()
9822 }
9823}
9824impl Default for CURRENT_MODE_DATA {
9825 fn default() -> Self {
9826 Self::DEFAULT.clone()
9827 }
9828}
9829impl MessageData for CURRENT_MODE_DATA {
9830 type Message = MavMessage;
9831 const ID: u32 = 436u32;
9832 const NAME: &'static str = "CURRENT_MODE";
9833 const EXTRA_CRC: u8 = 193u8;
9834 const ENCODED_LEN: usize = 9usize;
9835 fn deser(
9836 _version: MavlinkVersion,
9837 __input: &[u8],
9838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9839 let avail_len = __input.len();
9840 let mut payload_buf = [0; Self::ENCODED_LEN];
9841 let mut buf = if avail_len < Self::ENCODED_LEN {
9842 payload_buf[0..avail_len].copy_from_slice(__input);
9843 Bytes::new(&payload_buf)
9844 } else {
9845 Bytes::new(__input)
9846 };
9847 let mut __struct = Self::default();
9848 __struct.custom_mode = buf.get_u32_le();
9849 __struct.intended_custom_mode = buf.get_u32_le();
9850 let tmp = buf.get_u8();
9851 __struct.standard_mode =
9852 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9853 enum_type: "MavStandardMode",
9854 value: tmp as u32,
9855 })?;
9856 Ok(__struct)
9857 }
9858 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9859 let mut __tmp = BytesMut::new(bytes);
9860 #[allow(clippy::absurd_extreme_comparisons)]
9861 #[allow(unused_comparisons)]
9862 if __tmp.remaining() < Self::ENCODED_LEN {
9863 panic!(
9864 "buffer is too small (need {} bytes, but got {})",
9865 Self::ENCODED_LEN,
9866 __tmp.remaining(),
9867 )
9868 }
9869 __tmp.put_u32_le(self.custom_mode);
9870 __tmp.put_u32_le(self.intended_custom_mode);
9871 __tmp.put_u8(self.standard_mode as u8);
9872 if matches!(version, MavlinkVersion::V2) {
9873 let len = __tmp.len();
9874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9875 } else {
9876 __tmp.len()
9877 }
9878 }
9879}
9880#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
9881#[doc = "id: 67"]
9882#[doc = "Data stream status information."]
9883#[derive(Debug, Clone, PartialEq)]
9884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9886pub struct DATA_STREAM_DATA {
9887 #[doc = "The message rate"]
9888 pub message_rate: u16,
9889 #[doc = "The ID of the requested data stream"]
9890 pub stream_id: u8,
9891 #[doc = "1 stream is enabled, 0 stream is stopped."]
9892 pub on_off: u8,
9893}
9894impl DATA_STREAM_DATA {
9895 pub const ENCODED_LEN: usize = 4usize;
9896 pub const DEFAULT: Self = Self {
9897 message_rate: 0_u16,
9898 stream_id: 0_u8,
9899 on_off: 0_u8,
9900 };
9901 #[cfg(feature = "arbitrary")]
9902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9903 use arbitrary::{Arbitrary, Unstructured};
9904 let mut buf = [0u8; 1024];
9905 rng.fill_bytes(&mut buf);
9906 let mut unstructured = Unstructured::new(&buf);
9907 Self::arbitrary(&mut unstructured).unwrap_or_default()
9908 }
9909}
9910impl Default for DATA_STREAM_DATA {
9911 fn default() -> Self {
9912 Self::DEFAULT.clone()
9913 }
9914}
9915impl MessageData for DATA_STREAM_DATA {
9916 type Message = MavMessage;
9917 const ID: u32 = 67u32;
9918 const NAME: &'static str = "DATA_STREAM";
9919 const EXTRA_CRC: u8 = 21u8;
9920 const ENCODED_LEN: usize = 4usize;
9921 fn deser(
9922 _version: MavlinkVersion,
9923 __input: &[u8],
9924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9925 let avail_len = __input.len();
9926 let mut payload_buf = [0; Self::ENCODED_LEN];
9927 let mut buf = if avail_len < Self::ENCODED_LEN {
9928 payload_buf[0..avail_len].copy_from_slice(__input);
9929 Bytes::new(&payload_buf)
9930 } else {
9931 Bytes::new(__input)
9932 };
9933 let mut __struct = Self::default();
9934 __struct.message_rate = buf.get_u16_le();
9935 __struct.stream_id = buf.get_u8();
9936 __struct.on_off = buf.get_u8();
9937 Ok(__struct)
9938 }
9939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9940 let mut __tmp = BytesMut::new(bytes);
9941 #[allow(clippy::absurd_extreme_comparisons)]
9942 #[allow(unused_comparisons)]
9943 if __tmp.remaining() < Self::ENCODED_LEN {
9944 panic!(
9945 "buffer is too small (need {} bytes, but got {})",
9946 Self::ENCODED_LEN,
9947 __tmp.remaining(),
9948 )
9949 }
9950 __tmp.put_u16_le(self.message_rate);
9951 __tmp.put_u8(self.stream_id);
9952 __tmp.put_u8(self.on_off);
9953 if matches!(version, MavlinkVersion::V2) {
9954 let len = __tmp.len();
9955 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9956 } else {
9957 __tmp.len()
9958 }
9959 }
9960}
9961#[doc = "id: 130"]
9962#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
9963#[derive(Debug, Clone, PartialEq)]
9964#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9965#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9966pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
9967 #[doc = "total data size (set on ACK only)."]
9968 pub size: u32,
9969 #[doc = "Width of a matrix or image."]
9970 pub width: u16,
9971 #[doc = "Height of a matrix or image."]
9972 pub height: u16,
9973 #[doc = "Number of packets being sent (set on ACK only)."]
9974 pub packets: u16,
9975 #[doc = "Type of requested/acknowledged data."]
9976 pub mavtype: MavlinkDataStreamType,
9977 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
9978 pub payload: u8,
9979 #[doc = "JPEG quality. Values: [1-100]."]
9980 pub jpg_quality: u8,
9981}
9982impl DATA_TRANSMISSION_HANDSHAKE_DATA {
9983 pub const ENCODED_LEN: usize = 13usize;
9984 pub const DEFAULT: Self = Self {
9985 size: 0_u32,
9986 width: 0_u16,
9987 height: 0_u16,
9988 packets: 0_u16,
9989 mavtype: MavlinkDataStreamType::DEFAULT,
9990 payload: 0_u8,
9991 jpg_quality: 0_u8,
9992 };
9993 #[cfg(feature = "arbitrary")]
9994 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9995 use arbitrary::{Arbitrary, Unstructured};
9996 let mut buf = [0u8; 1024];
9997 rng.fill_bytes(&mut buf);
9998 let mut unstructured = Unstructured::new(&buf);
9999 Self::arbitrary(&mut unstructured).unwrap_or_default()
10000 }
10001}
10002impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10003 fn default() -> Self {
10004 Self::DEFAULT.clone()
10005 }
10006}
10007impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10008 type Message = MavMessage;
10009 const ID: u32 = 130u32;
10010 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10011 const EXTRA_CRC: u8 = 29u8;
10012 const ENCODED_LEN: usize = 13usize;
10013 fn deser(
10014 _version: MavlinkVersion,
10015 __input: &[u8],
10016 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10017 let avail_len = __input.len();
10018 let mut payload_buf = [0; Self::ENCODED_LEN];
10019 let mut buf = if avail_len < Self::ENCODED_LEN {
10020 payload_buf[0..avail_len].copy_from_slice(__input);
10021 Bytes::new(&payload_buf)
10022 } else {
10023 Bytes::new(__input)
10024 };
10025 let mut __struct = Self::default();
10026 __struct.size = buf.get_u32_le();
10027 __struct.width = buf.get_u16_le();
10028 __struct.height = buf.get_u16_le();
10029 __struct.packets = buf.get_u16_le();
10030 let tmp = buf.get_u8();
10031 __struct.mavtype =
10032 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10033 enum_type: "MavlinkDataStreamType",
10034 value: tmp as u32,
10035 })?;
10036 __struct.payload = buf.get_u8();
10037 __struct.jpg_quality = buf.get_u8();
10038 Ok(__struct)
10039 }
10040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10041 let mut __tmp = BytesMut::new(bytes);
10042 #[allow(clippy::absurd_extreme_comparisons)]
10043 #[allow(unused_comparisons)]
10044 if __tmp.remaining() < Self::ENCODED_LEN {
10045 panic!(
10046 "buffer is too small (need {} bytes, but got {})",
10047 Self::ENCODED_LEN,
10048 __tmp.remaining(),
10049 )
10050 }
10051 __tmp.put_u32_le(self.size);
10052 __tmp.put_u16_le(self.width);
10053 __tmp.put_u16_le(self.height);
10054 __tmp.put_u16_le(self.packets);
10055 __tmp.put_u8(self.mavtype as u8);
10056 __tmp.put_u8(self.payload);
10057 __tmp.put_u8(self.jpg_quality);
10058 if matches!(version, MavlinkVersion::V2) {
10059 let len = __tmp.len();
10060 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10061 } else {
10062 __tmp.len()
10063 }
10064 }
10065}
10066#[doc = "id: 254"]
10067#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10068#[derive(Debug, Clone, PartialEq)]
10069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10071pub struct DEBUG_DATA {
10072 #[doc = "Timestamp (time since system boot)."]
10073 pub time_boot_ms: u32,
10074 #[doc = "DEBUG value"]
10075 pub value: f32,
10076 #[doc = "index of debug variable"]
10077 pub ind: u8,
10078}
10079impl DEBUG_DATA {
10080 pub const ENCODED_LEN: usize = 9usize;
10081 pub const DEFAULT: Self = Self {
10082 time_boot_ms: 0_u32,
10083 value: 0.0_f32,
10084 ind: 0_u8,
10085 };
10086 #[cfg(feature = "arbitrary")]
10087 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10088 use arbitrary::{Arbitrary, Unstructured};
10089 let mut buf = [0u8; 1024];
10090 rng.fill_bytes(&mut buf);
10091 let mut unstructured = Unstructured::new(&buf);
10092 Self::arbitrary(&mut unstructured).unwrap_or_default()
10093 }
10094}
10095impl Default for DEBUG_DATA {
10096 fn default() -> Self {
10097 Self::DEFAULT.clone()
10098 }
10099}
10100impl MessageData for DEBUG_DATA {
10101 type Message = MavMessage;
10102 const ID: u32 = 254u32;
10103 const NAME: &'static str = "DEBUG";
10104 const EXTRA_CRC: u8 = 46u8;
10105 const ENCODED_LEN: usize = 9usize;
10106 fn deser(
10107 _version: MavlinkVersion,
10108 __input: &[u8],
10109 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10110 let avail_len = __input.len();
10111 let mut payload_buf = [0; Self::ENCODED_LEN];
10112 let mut buf = if avail_len < Self::ENCODED_LEN {
10113 payload_buf[0..avail_len].copy_from_slice(__input);
10114 Bytes::new(&payload_buf)
10115 } else {
10116 Bytes::new(__input)
10117 };
10118 let mut __struct = Self::default();
10119 __struct.time_boot_ms = buf.get_u32_le();
10120 __struct.value = buf.get_f32_le();
10121 __struct.ind = buf.get_u8();
10122 Ok(__struct)
10123 }
10124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10125 let mut __tmp = BytesMut::new(bytes);
10126 #[allow(clippy::absurd_extreme_comparisons)]
10127 #[allow(unused_comparisons)]
10128 if __tmp.remaining() < Self::ENCODED_LEN {
10129 panic!(
10130 "buffer is too small (need {} bytes, but got {})",
10131 Self::ENCODED_LEN,
10132 __tmp.remaining(),
10133 )
10134 }
10135 __tmp.put_u32_le(self.time_boot_ms);
10136 __tmp.put_f32_le(self.value);
10137 __tmp.put_u8(self.ind);
10138 if matches!(version, MavlinkVersion::V2) {
10139 let len = __tmp.len();
10140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10141 } else {
10142 __tmp.len()
10143 }
10144 }
10145}
10146#[doc = "id: 350"]
10147#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10148#[derive(Debug, Clone, PartialEq)]
10149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10150#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10151pub struct DEBUG_FLOAT_ARRAY_DATA {
10152 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10153 pub time_usec: u64,
10154 #[doc = "Unique ID used to discriminate between arrays"]
10155 pub array_id: u16,
10156 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10158 pub name: [u8; 10],
10159 #[doc = "data"]
10160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10161 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10162 pub data: [f32; 58],
10163}
10164impl DEBUG_FLOAT_ARRAY_DATA {
10165 pub const ENCODED_LEN: usize = 252usize;
10166 pub const DEFAULT: Self = Self {
10167 time_usec: 0_u64,
10168 array_id: 0_u16,
10169 name: [0_u8; 10usize],
10170 data: [0.0_f32; 58usize],
10171 };
10172 #[cfg(feature = "arbitrary")]
10173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10174 use arbitrary::{Arbitrary, Unstructured};
10175 let mut buf = [0u8; 1024];
10176 rng.fill_bytes(&mut buf);
10177 let mut unstructured = Unstructured::new(&buf);
10178 Self::arbitrary(&mut unstructured).unwrap_or_default()
10179 }
10180}
10181impl Default for DEBUG_FLOAT_ARRAY_DATA {
10182 fn default() -> Self {
10183 Self::DEFAULT.clone()
10184 }
10185}
10186impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10187 type Message = MavMessage;
10188 const ID: u32 = 350u32;
10189 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10190 const EXTRA_CRC: u8 = 232u8;
10191 const ENCODED_LEN: usize = 252usize;
10192 fn deser(
10193 _version: MavlinkVersion,
10194 __input: &[u8],
10195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10196 let avail_len = __input.len();
10197 let mut payload_buf = [0; Self::ENCODED_LEN];
10198 let mut buf = if avail_len < Self::ENCODED_LEN {
10199 payload_buf[0..avail_len].copy_from_slice(__input);
10200 Bytes::new(&payload_buf)
10201 } else {
10202 Bytes::new(__input)
10203 };
10204 let mut __struct = Self::default();
10205 __struct.time_usec = buf.get_u64_le();
10206 __struct.array_id = buf.get_u16_le();
10207 for v in &mut __struct.name {
10208 let val = buf.get_u8();
10209 *v = val;
10210 }
10211 for v in &mut __struct.data {
10212 let val = buf.get_f32_le();
10213 *v = val;
10214 }
10215 Ok(__struct)
10216 }
10217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10218 let mut __tmp = BytesMut::new(bytes);
10219 #[allow(clippy::absurd_extreme_comparisons)]
10220 #[allow(unused_comparisons)]
10221 if __tmp.remaining() < Self::ENCODED_LEN {
10222 panic!(
10223 "buffer is too small (need {} bytes, but got {})",
10224 Self::ENCODED_LEN,
10225 __tmp.remaining(),
10226 )
10227 }
10228 __tmp.put_u64_le(self.time_usec);
10229 __tmp.put_u16_le(self.array_id);
10230 for val in &self.name {
10231 __tmp.put_u8(*val);
10232 }
10233 for val in &self.data {
10234 __tmp.put_f32_le(*val);
10235 }
10236 if matches!(version, MavlinkVersion::V2) {
10237 let len = __tmp.len();
10238 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10239 } else {
10240 __tmp.len()
10241 }
10242 }
10243}
10244#[doc = "id: 250"]
10245#[doc = "To debug something using a named 3D vector."]
10246#[derive(Debug, Clone, PartialEq)]
10247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10249pub struct DEBUG_VECT_DATA {
10250 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10251 pub time_usec: u64,
10252 #[doc = "x"]
10253 pub x: f32,
10254 #[doc = "y"]
10255 pub y: f32,
10256 #[doc = "z"]
10257 pub z: f32,
10258 #[doc = "Name"]
10259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10260 pub name: [u8; 10],
10261}
10262impl DEBUG_VECT_DATA {
10263 pub const ENCODED_LEN: usize = 30usize;
10264 pub const DEFAULT: Self = Self {
10265 time_usec: 0_u64,
10266 x: 0.0_f32,
10267 y: 0.0_f32,
10268 z: 0.0_f32,
10269 name: [0_u8; 10usize],
10270 };
10271 #[cfg(feature = "arbitrary")]
10272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10273 use arbitrary::{Arbitrary, Unstructured};
10274 let mut buf = [0u8; 1024];
10275 rng.fill_bytes(&mut buf);
10276 let mut unstructured = Unstructured::new(&buf);
10277 Self::arbitrary(&mut unstructured).unwrap_or_default()
10278 }
10279}
10280impl Default for DEBUG_VECT_DATA {
10281 fn default() -> Self {
10282 Self::DEFAULT.clone()
10283 }
10284}
10285impl MessageData for DEBUG_VECT_DATA {
10286 type Message = MavMessage;
10287 const ID: u32 = 250u32;
10288 const NAME: &'static str = "DEBUG_VECT";
10289 const EXTRA_CRC: u8 = 49u8;
10290 const ENCODED_LEN: usize = 30usize;
10291 fn deser(
10292 _version: MavlinkVersion,
10293 __input: &[u8],
10294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10295 let avail_len = __input.len();
10296 let mut payload_buf = [0; Self::ENCODED_LEN];
10297 let mut buf = if avail_len < Self::ENCODED_LEN {
10298 payload_buf[0..avail_len].copy_from_slice(__input);
10299 Bytes::new(&payload_buf)
10300 } else {
10301 Bytes::new(__input)
10302 };
10303 let mut __struct = Self::default();
10304 __struct.time_usec = buf.get_u64_le();
10305 __struct.x = buf.get_f32_le();
10306 __struct.y = buf.get_f32_le();
10307 __struct.z = buf.get_f32_le();
10308 for v in &mut __struct.name {
10309 let val = buf.get_u8();
10310 *v = val;
10311 }
10312 Ok(__struct)
10313 }
10314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10315 let mut __tmp = BytesMut::new(bytes);
10316 #[allow(clippy::absurd_extreme_comparisons)]
10317 #[allow(unused_comparisons)]
10318 if __tmp.remaining() < Self::ENCODED_LEN {
10319 panic!(
10320 "buffer is too small (need {} bytes, but got {})",
10321 Self::ENCODED_LEN,
10322 __tmp.remaining(),
10323 )
10324 }
10325 __tmp.put_u64_le(self.time_usec);
10326 __tmp.put_f32_le(self.x);
10327 __tmp.put_f32_le(self.y);
10328 __tmp.put_f32_le(self.z);
10329 for val in &self.name {
10330 __tmp.put_u8(*val);
10331 }
10332 if matches!(version, MavlinkVersion::V2) {
10333 let len = __tmp.len();
10334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10335 } else {
10336 __tmp.len()
10337 }
10338 }
10339}
10340#[doc = "id: 132"]
10341#[doc = "Distance sensor information for an onboard rangefinder."]
10342#[derive(Debug, Clone, PartialEq)]
10343#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10344#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10345pub struct DISTANCE_SENSOR_DATA {
10346 #[doc = "Timestamp (time since system boot)."]
10347 pub time_boot_ms: u32,
10348 #[doc = "Minimum distance the sensor can measure"]
10349 pub min_distance: u16,
10350 #[doc = "Maximum distance the sensor can measure"]
10351 pub max_distance: u16,
10352 #[doc = "Current distance reading"]
10353 pub current_distance: u16,
10354 #[doc = "Type of distance sensor."]
10355 pub mavtype: MavDistanceSensor,
10356 #[doc = "Onboard ID of the sensor"]
10357 pub id: u8,
10358 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10359 pub orientation: MavSensorOrientation,
10360 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10361 pub covariance: u8,
10362 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10363 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10364 pub horizontal_fov: f32,
10365 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10366 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10367 pub vertical_fov: f32,
10368 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10369 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10370 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10371 pub quaternion: [f32; 4],
10372 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10373 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10374 pub signal_quality: u8,
10375}
10376impl DISTANCE_SENSOR_DATA {
10377 pub const ENCODED_LEN: usize = 39usize;
10378 pub const DEFAULT: Self = Self {
10379 time_boot_ms: 0_u32,
10380 min_distance: 0_u16,
10381 max_distance: 0_u16,
10382 current_distance: 0_u16,
10383 mavtype: MavDistanceSensor::DEFAULT,
10384 id: 0_u8,
10385 orientation: MavSensorOrientation::DEFAULT,
10386 covariance: 0_u8,
10387 horizontal_fov: 0.0_f32,
10388 vertical_fov: 0.0_f32,
10389 quaternion: [0.0_f32; 4usize],
10390 signal_quality: 0_u8,
10391 };
10392 #[cfg(feature = "arbitrary")]
10393 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10394 use arbitrary::{Arbitrary, Unstructured};
10395 let mut buf = [0u8; 1024];
10396 rng.fill_bytes(&mut buf);
10397 let mut unstructured = Unstructured::new(&buf);
10398 Self::arbitrary(&mut unstructured).unwrap_or_default()
10399 }
10400}
10401impl Default for DISTANCE_SENSOR_DATA {
10402 fn default() -> Self {
10403 Self::DEFAULT.clone()
10404 }
10405}
10406impl MessageData for DISTANCE_SENSOR_DATA {
10407 type Message = MavMessage;
10408 const ID: u32 = 132u32;
10409 const NAME: &'static str = "DISTANCE_SENSOR";
10410 const EXTRA_CRC: u8 = 85u8;
10411 const ENCODED_LEN: usize = 39usize;
10412 fn deser(
10413 _version: MavlinkVersion,
10414 __input: &[u8],
10415 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10416 let avail_len = __input.len();
10417 let mut payload_buf = [0; Self::ENCODED_LEN];
10418 let mut buf = if avail_len < Self::ENCODED_LEN {
10419 payload_buf[0..avail_len].copy_from_slice(__input);
10420 Bytes::new(&payload_buf)
10421 } else {
10422 Bytes::new(__input)
10423 };
10424 let mut __struct = Self::default();
10425 __struct.time_boot_ms = buf.get_u32_le();
10426 __struct.min_distance = buf.get_u16_le();
10427 __struct.max_distance = buf.get_u16_le();
10428 __struct.current_distance = buf.get_u16_le();
10429 let tmp = buf.get_u8();
10430 __struct.mavtype =
10431 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10432 enum_type: "MavDistanceSensor",
10433 value: tmp as u32,
10434 })?;
10435 __struct.id = buf.get_u8();
10436 let tmp = buf.get_u8();
10437 __struct.orientation =
10438 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10439 enum_type: "MavSensorOrientation",
10440 value: tmp as u32,
10441 })?;
10442 __struct.covariance = buf.get_u8();
10443 __struct.horizontal_fov = buf.get_f32_le();
10444 __struct.vertical_fov = buf.get_f32_le();
10445 for v in &mut __struct.quaternion {
10446 let val = buf.get_f32_le();
10447 *v = val;
10448 }
10449 __struct.signal_quality = buf.get_u8();
10450 Ok(__struct)
10451 }
10452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10453 let mut __tmp = BytesMut::new(bytes);
10454 #[allow(clippy::absurd_extreme_comparisons)]
10455 #[allow(unused_comparisons)]
10456 if __tmp.remaining() < Self::ENCODED_LEN {
10457 panic!(
10458 "buffer is too small (need {} bytes, but got {})",
10459 Self::ENCODED_LEN,
10460 __tmp.remaining(),
10461 )
10462 }
10463 __tmp.put_u32_le(self.time_boot_ms);
10464 __tmp.put_u16_le(self.min_distance);
10465 __tmp.put_u16_le(self.max_distance);
10466 __tmp.put_u16_le(self.current_distance);
10467 __tmp.put_u8(self.mavtype as u8);
10468 __tmp.put_u8(self.id);
10469 __tmp.put_u8(self.orientation as u8);
10470 __tmp.put_u8(self.covariance);
10471 __tmp.put_f32_le(self.horizontal_fov);
10472 __tmp.put_f32_le(self.vertical_fov);
10473 for val in &self.quaternion {
10474 __tmp.put_f32_le(*val);
10475 }
10476 __tmp.put_u8(self.signal_quality);
10477 if matches!(version, MavlinkVersion::V2) {
10478 let len = __tmp.len();
10479 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10480 } else {
10481 __tmp.len()
10482 }
10483 }
10484}
10485#[doc = "id: 225"]
10486#[doc = "EFI status output."]
10487#[derive(Debug, Clone, PartialEq)]
10488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10490pub struct EFI_STATUS_DATA {
10491 #[doc = "ECU index"]
10492 pub ecu_index: f32,
10493 #[doc = "RPM"]
10494 pub rpm: f32,
10495 #[doc = "Fuel consumed"]
10496 pub fuel_consumed: f32,
10497 #[doc = "Fuel flow rate"]
10498 pub fuel_flow: f32,
10499 #[doc = "Engine load"]
10500 pub engine_load: f32,
10501 #[doc = "Throttle position"]
10502 pub throttle_position: f32,
10503 #[doc = "Spark dwell time"]
10504 pub spark_dwell_time: f32,
10505 #[doc = "Barometric pressure"]
10506 pub barometric_pressure: f32,
10507 #[doc = "Intake manifold pressure("]
10508 pub intake_manifold_pressure: f32,
10509 #[doc = "Intake manifold temperature"]
10510 pub intake_manifold_temperature: f32,
10511 #[doc = "Cylinder head temperature"]
10512 pub cylinder_head_temperature: f32,
10513 #[doc = "Ignition timing (Crank angle degrees)"]
10514 pub ignition_timing: f32,
10515 #[doc = "Injection time"]
10516 pub injection_time: f32,
10517 #[doc = "Exhaust gas temperature"]
10518 pub exhaust_gas_temperature: f32,
10519 #[doc = "Output throttle"]
10520 pub throttle_out: f32,
10521 #[doc = "Pressure/temperature compensation"]
10522 pub pt_compensation: f32,
10523 #[doc = "EFI health status"]
10524 pub health: u8,
10525 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10526 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10527 pub ignition_voltage: f32,
10528 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10529 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10530 pub fuel_pressure: f32,
10531}
10532impl EFI_STATUS_DATA {
10533 pub const ENCODED_LEN: usize = 73usize;
10534 pub const DEFAULT: Self = Self {
10535 ecu_index: 0.0_f32,
10536 rpm: 0.0_f32,
10537 fuel_consumed: 0.0_f32,
10538 fuel_flow: 0.0_f32,
10539 engine_load: 0.0_f32,
10540 throttle_position: 0.0_f32,
10541 spark_dwell_time: 0.0_f32,
10542 barometric_pressure: 0.0_f32,
10543 intake_manifold_pressure: 0.0_f32,
10544 intake_manifold_temperature: 0.0_f32,
10545 cylinder_head_temperature: 0.0_f32,
10546 ignition_timing: 0.0_f32,
10547 injection_time: 0.0_f32,
10548 exhaust_gas_temperature: 0.0_f32,
10549 throttle_out: 0.0_f32,
10550 pt_compensation: 0.0_f32,
10551 health: 0_u8,
10552 ignition_voltage: 0.0_f32,
10553 fuel_pressure: 0.0_f32,
10554 };
10555 #[cfg(feature = "arbitrary")]
10556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10557 use arbitrary::{Arbitrary, Unstructured};
10558 let mut buf = [0u8; 1024];
10559 rng.fill_bytes(&mut buf);
10560 let mut unstructured = Unstructured::new(&buf);
10561 Self::arbitrary(&mut unstructured).unwrap_or_default()
10562 }
10563}
10564impl Default for EFI_STATUS_DATA {
10565 fn default() -> Self {
10566 Self::DEFAULT.clone()
10567 }
10568}
10569impl MessageData for EFI_STATUS_DATA {
10570 type Message = MavMessage;
10571 const ID: u32 = 225u32;
10572 const NAME: &'static str = "EFI_STATUS";
10573 const EXTRA_CRC: u8 = 208u8;
10574 const ENCODED_LEN: usize = 73usize;
10575 fn deser(
10576 _version: MavlinkVersion,
10577 __input: &[u8],
10578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10579 let avail_len = __input.len();
10580 let mut payload_buf = [0; Self::ENCODED_LEN];
10581 let mut buf = if avail_len < Self::ENCODED_LEN {
10582 payload_buf[0..avail_len].copy_from_slice(__input);
10583 Bytes::new(&payload_buf)
10584 } else {
10585 Bytes::new(__input)
10586 };
10587 let mut __struct = Self::default();
10588 __struct.ecu_index = buf.get_f32_le();
10589 __struct.rpm = buf.get_f32_le();
10590 __struct.fuel_consumed = buf.get_f32_le();
10591 __struct.fuel_flow = buf.get_f32_le();
10592 __struct.engine_load = buf.get_f32_le();
10593 __struct.throttle_position = buf.get_f32_le();
10594 __struct.spark_dwell_time = buf.get_f32_le();
10595 __struct.barometric_pressure = buf.get_f32_le();
10596 __struct.intake_manifold_pressure = buf.get_f32_le();
10597 __struct.intake_manifold_temperature = buf.get_f32_le();
10598 __struct.cylinder_head_temperature = buf.get_f32_le();
10599 __struct.ignition_timing = buf.get_f32_le();
10600 __struct.injection_time = buf.get_f32_le();
10601 __struct.exhaust_gas_temperature = buf.get_f32_le();
10602 __struct.throttle_out = buf.get_f32_le();
10603 __struct.pt_compensation = buf.get_f32_le();
10604 __struct.health = buf.get_u8();
10605 __struct.ignition_voltage = buf.get_f32_le();
10606 __struct.fuel_pressure = buf.get_f32_le();
10607 Ok(__struct)
10608 }
10609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10610 let mut __tmp = BytesMut::new(bytes);
10611 #[allow(clippy::absurd_extreme_comparisons)]
10612 #[allow(unused_comparisons)]
10613 if __tmp.remaining() < Self::ENCODED_LEN {
10614 panic!(
10615 "buffer is too small (need {} bytes, but got {})",
10616 Self::ENCODED_LEN,
10617 __tmp.remaining(),
10618 )
10619 }
10620 __tmp.put_f32_le(self.ecu_index);
10621 __tmp.put_f32_le(self.rpm);
10622 __tmp.put_f32_le(self.fuel_consumed);
10623 __tmp.put_f32_le(self.fuel_flow);
10624 __tmp.put_f32_le(self.engine_load);
10625 __tmp.put_f32_le(self.throttle_position);
10626 __tmp.put_f32_le(self.spark_dwell_time);
10627 __tmp.put_f32_le(self.barometric_pressure);
10628 __tmp.put_f32_le(self.intake_manifold_pressure);
10629 __tmp.put_f32_le(self.intake_manifold_temperature);
10630 __tmp.put_f32_le(self.cylinder_head_temperature);
10631 __tmp.put_f32_le(self.ignition_timing);
10632 __tmp.put_f32_le(self.injection_time);
10633 __tmp.put_f32_le(self.exhaust_gas_temperature);
10634 __tmp.put_f32_le(self.throttle_out);
10635 __tmp.put_f32_le(self.pt_compensation);
10636 __tmp.put_u8(self.health);
10637 __tmp.put_f32_le(self.ignition_voltage);
10638 __tmp.put_f32_le(self.fuel_pressure);
10639 if matches!(version, MavlinkVersion::V2) {
10640 let len = __tmp.len();
10641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10642 } else {
10643 __tmp.len()
10644 }
10645 }
10646}
10647#[doc = "id: 131"]
10648#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10649#[derive(Debug, Clone, PartialEq)]
10650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10652pub struct ENCAPSULATED_DATA_DATA {
10653 #[doc = "sequence number (starting with 0 on every transmission)"]
10654 pub seqnr: u16,
10655 #[doc = "image data bytes"]
10656 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10657 pub data: [u8; 253],
10658}
10659impl ENCAPSULATED_DATA_DATA {
10660 pub const ENCODED_LEN: usize = 255usize;
10661 pub const DEFAULT: Self = Self {
10662 seqnr: 0_u16,
10663 data: [0_u8; 253usize],
10664 };
10665 #[cfg(feature = "arbitrary")]
10666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10667 use arbitrary::{Arbitrary, Unstructured};
10668 let mut buf = [0u8; 1024];
10669 rng.fill_bytes(&mut buf);
10670 let mut unstructured = Unstructured::new(&buf);
10671 Self::arbitrary(&mut unstructured).unwrap_or_default()
10672 }
10673}
10674impl Default for ENCAPSULATED_DATA_DATA {
10675 fn default() -> Self {
10676 Self::DEFAULT.clone()
10677 }
10678}
10679impl MessageData for ENCAPSULATED_DATA_DATA {
10680 type Message = MavMessage;
10681 const ID: u32 = 131u32;
10682 const NAME: &'static str = "ENCAPSULATED_DATA";
10683 const EXTRA_CRC: u8 = 223u8;
10684 const ENCODED_LEN: usize = 255usize;
10685 fn deser(
10686 _version: MavlinkVersion,
10687 __input: &[u8],
10688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10689 let avail_len = __input.len();
10690 let mut payload_buf = [0; Self::ENCODED_LEN];
10691 let mut buf = if avail_len < Self::ENCODED_LEN {
10692 payload_buf[0..avail_len].copy_from_slice(__input);
10693 Bytes::new(&payload_buf)
10694 } else {
10695 Bytes::new(__input)
10696 };
10697 let mut __struct = Self::default();
10698 __struct.seqnr = buf.get_u16_le();
10699 for v in &mut __struct.data {
10700 let val = buf.get_u8();
10701 *v = val;
10702 }
10703 Ok(__struct)
10704 }
10705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10706 let mut __tmp = BytesMut::new(bytes);
10707 #[allow(clippy::absurd_extreme_comparisons)]
10708 #[allow(unused_comparisons)]
10709 if __tmp.remaining() < Self::ENCODED_LEN {
10710 panic!(
10711 "buffer is too small (need {} bytes, but got {})",
10712 Self::ENCODED_LEN,
10713 __tmp.remaining(),
10714 )
10715 }
10716 __tmp.put_u16_le(self.seqnr);
10717 for val in &self.data {
10718 __tmp.put_u8(*val);
10719 }
10720 if matches!(version, MavlinkVersion::V2) {
10721 let len = __tmp.len();
10722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10723 } else {
10724 __tmp.len()
10725 }
10726 }
10727}
10728#[doc = "id: 290"]
10729#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
10730#[derive(Debug, Clone, PartialEq)]
10731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10733pub struct ESC_INFO_DATA {
10734 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10735 pub time_usec: u64,
10736 #[doc = "Number of reported errors by each ESC since boot."]
10737 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10738 pub error_count: [u32; 4],
10739 #[doc = "Counter of data packets received."]
10740 pub counter: u16,
10741 #[doc = "Bitmap of ESC failure flags."]
10742 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10743 pub failure_flags: [u16; 4],
10744 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
10745 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10746 pub temperature: [i16; 4],
10747 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10748 pub index: u8,
10749 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
10750 pub count: u8,
10751 #[doc = "Connection type protocol for all ESC."]
10752 pub connection_type: EscConnectionType,
10753 #[doc = "Information regarding online/offline status of each ESC."]
10754 pub info: u8,
10755}
10756impl ESC_INFO_DATA {
10757 pub const ENCODED_LEN: usize = 46usize;
10758 pub const DEFAULT: Self = Self {
10759 time_usec: 0_u64,
10760 error_count: [0_u32; 4usize],
10761 counter: 0_u16,
10762 failure_flags: [0_u16; 4usize],
10763 temperature: [0_i16; 4usize],
10764 index: 0_u8,
10765 count: 0_u8,
10766 connection_type: EscConnectionType::DEFAULT,
10767 info: 0_u8,
10768 };
10769 #[cfg(feature = "arbitrary")]
10770 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10771 use arbitrary::{Arbitrary, Unstructured};
10772 let mut buf = [0u8; 1024];
10773 rng.fill_bytes(&mut buf);
10774 let mut unstructured = Unstructured::new(&buf);
10775 Self::arbitrary(&mut unstructured).unwrap_or_default()
10776 }
10777}
10778impl Default for ESC_INFO_DATA {
10779 fn default() -> Self {
10780 Self::DEFAULT.clone()
10781 }
10782}
10783impl MessageData for ESC_INFO_DATA {
10784 type Message = MavMessage;
10785 const ID: u32 = 290u32;
10786 const NAME: &'static str = "ESC_INFO";
10787 const EXTRA_CRC: u8 = 251u8;
10788 const ENCODED_LEN: usize = 46usize;
10789 fn deser(
10790 _version: MavlinkVersion,
10791 __input: &[u8],
10792 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10793 let avail_len = __input.len();
10794 let mut payload_buf = [0; Self::ENCODED_LEN];
10795 let mut buf = if avail_len < Self::ENCODED_LEN {
10796 payload_buf[0..avail_len].copy_from_slice(__input);
10797 Bytes::new(&payload_buf)
10798 } else {
10799 Bytes::new(__input)
10800 };
10801 let mut __struct = Self::default();
10802 __struct.time_usec = buf.get_u64_le();
10803 for v in &mut __struct.error_count {
10804 let val = buf.get_u32_le();
10805 *v = val;
10806 }
10807 __struct.counter = buf.get_u16_le();
10808 for v in &mut __struct.failure_flags {
10809 let val = buf.get_u16_le();
10810 *v = val;
10811 }
10812 for v in &mut __struct.temperature {
10813 let val = buf.get_i16_le();
10814 *v = val;
10815 }
10816 __struct.index = buf.get_u8();
10817 __struct.count = buf.get_u8();
10818 let tmp = buf.get_u8();
10819 __struct.connection_type =
10820 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10821 enum_type: "EscConnectionType",
10822 value: tmp as u32,
10823 })?;
10824 __struct.info = buf.get_u8();
10825 Ok(__struct)
10826 }
10827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10828 let mut __tmp = BytesMut::new(bytes);
10829 #[allow(clippy::absurd_extreme_comparisons)]
10830 #[allow(unused_comparisons)]
10831 if __tmp.remaining() < Self::ENCODED_LEN {
10832 panic!(
10833 "buffer is too small (need {} bytes, but got {})",
10834 Self::ENCODED_LEN,
10835 __tmp.remaining(),
10836 )
10837 }
10838 __tmp.put_u64_le(self.time_usec);
10839 for val in &self.error_count {
10840 __tmp.put_u32_le(*val);
10841 }
10842 __tmp.put_u16_le(self.counter);
10843 for val in &self.failure_flags {
10844 __tmp.put_u16_le(*val);
10845 }
10846 for val in &self.temperature {
10847 __tmp.put_i16_le(*val);
10848 }
10849 __tmp.put_u8(self.index);
10850 __tmp.put_u8(self.count);
10851 __tmp.put_u8(self.connection_type as u8);
10852 __tmp.put_u8(self.info);
10853 if matches!(version, MavlinkVersion::V2) {
10854 let len = __tmp.len();
10855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10856 } else {
10857 __tmp.len()
10858 }
10859 }
10860}
10861#[doc = "id: 291"]
10862#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
10863#[derive(Debug, Clone, PartialEq)]
10864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10866pub struct ESC_STATUS_DATA {
10867 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
10868 pub time_usec: u64,
10869 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
10870 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10871 pub rpm: [i32; 4],
10872 #[doc = "Voltage measured from each ESC."]
10873 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10874 pub voltage: [f32; 4],
10875 #[doc = "Current measured from each ESC."]
10876 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10877 pub current: [f32; 4],
10878 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
10879 pub index: u8,
10880}
10881impl ESC_STATUS_DATA {
10882 pub const ENCODED_LEN: usize = 57usize;
10883 pub const DEFAULT: Self = Self {
10884 time_usec: 0_u64,
10885 rpm: [0_i32; 4usize],
10886 voltage: [0.0_f32; 4usize],
10887 current: [0.0_f32; 4usize],
10888 index: 0_u8,
10889 };
10890 #[cfg(feature = "arbitrary")]
10891 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10892 use arbitrary::{Arbitrary, Unstructured};
10893 let mut buf = [0u8; 1024];
10894 rng.fill_bytes(&mut buf);
10895 let mut unstructured = Unstructured::new(&buf);
10896 Self::arbitrary(&mut unstructured).unwrap_or_default()
10897 }
10898}
10899impl Default for ESC_STATUS_DATA {
10900 fn default() -> Self {
10901 Self::DEFAULT.clone()
10902 }
10903}
10904impl MessageData for ESC_STATUS_DATA {
10905 type Message = MavMessage;
10906 const ID: u32 = 291u32;
10907 const NAME: &'static str = "ESC_STATUS";
10908 const EXTRA_CRC: u8 = 10u8;
10909 const ENCODED_LEN: usize = 57usize;
10910 fn deser(
10911 _version: MavlinkVersion,
10912 __input: &[u8],
10913 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10914 let avail_len = __input.len();
10915 let mut payload_buf = [0; Self::ENCODED_LEN];
10916 let mut buf = if avail_len < Self::ENCODED_LEN {
10917 payload_buf[0..avail_len].copy_from_slice(__input);
10918 Bytes::new(&payload_buf)
10919 } else {
10920 Bytes::new(__input)
10921 };
10922 let mut __struct = Self::default();
10923 __struct.time_usec = buf.get_u64_le();
10924 for v in &mut __struct.rpm {
10925 let val = buf.get_i32_le();
10926 *v = val;
10927 }
10928 for v in &mut __struct.voltage {
10929 let val = buf.get_f32_le();
10930 *v = val;
10931 }
10932 for v in &mut __struct.current {
10933 let val = buf.get_f32_le();
10934 *v = val;
10935 }
10936 __struct.index = buf.get_u8();
10937 Ok(__struct)
10938 }
10939 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10940 let mut __tmp = BytesMut::new(bytes);
10941 #[allow(clippy::absurd_extreme_comparisons)]
10942 #[allow(unused_comparisons)]
10943 if __tmp.remaining() < Self::ENCODED_LEN {
10944 panic!(
10945 "buffer is too small (need {} bytes, but got {})",
10946 Self::ENCODED_LEN,
10947 __tmp.remaining(),
10948 )
10949 }
10950 __tmp.put_u64_le(self.time_usec);
10951 for val in &self.rpm {
10952 __tmp.put_i32_le(*val);
10953 }
10954 for val in &self.voltage {
10955 __tmp.put_f32_le(*val);
10956 }
10957 for val in &self.current {
10958 __tmp.put_f32_le(*val);
10959 }
10960 __tmp.put_u8(self.index);
10961 if matches!(version, MavlinkVersion::V2) {
10962 let len = __tmp.len();
10963 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10964 } else {
10965 __tmp.len()
10966 }
10967 }
10968}
10969#[doc = "id: 230"]
10970#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
10971#[derive(Debug, Clone, PartialEq)]
10972#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10974pub struct ESTIMATOR_STATUS_DATA {
10975 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10976 pub time_usec: u64,
10977 #[doc = "Velocity innovation test ratio"]
10978 pub vel_ratio: f32,
10979 #[doc = "Horizontal position innovation test ratio"]
10980 pub pos_horiz_ratio: f32,
10981 #[doc = "Vertical position innovation test ratio"]
10982 pub pos_vert_ratio: f32,
10983 #[doc = "Magnetometer innovation test ratio"]
10984 pub mag_ratio: f32,
10985 #[doc = "Height above terrain innovation test ratio"]
10986 pub hagl_ratio: f32,
10987 #[doc = "True airspeed innovation test ratio"]
10988 pub tas_ratio: f32,
10989 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
10990 pub pos_horiz_accuracy: f32,
10991 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
10992 pub pos_vert_accuracy: f32,
10993 #[doc = "Bitmap indicating which EKF outputs are valid."]
10994 pub flags: EstimatorStatusFlags,
10995}
10996impl ESTIMATOR_STATUS_DATA {
10997 pub const ENCODED_LEN: usize = 42usize;
10998 pub const DEFAULT: Self = Self {
10999 time_usec: 0_u64,
11000 vel_ratio: 0.0_f32,
11001 pos_horiz_ratio: 0.0_f32,
11002 pos_vert_ratio: 0.0_f32,
11003 mag_ratio: 0.0_f32,
11004 hagl_ratio: 0.0_f32,
11005 tas_ratio: 0.0_f32,
11006 pos_horiz_accuracy: 0.0_f32,
11007 pos_vert_accuracy: 0.0_f32,
11008 flags: EstimatorStatusFlags::DEFAULT,
11009 };
11010 #[cfg(feature = "arbitrary")]
11011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11012 use arbitrary::{Arbitrary, Unstructured};
11013 let mut buf = [0u8; 1024];
11014 rng.fill_bytes(&mut buf);
11015 let mut unstructured = Unstructured::new(&buf);
11016 Self::arbitrary(&mut unstructured).unwrap_or_default()
11017 }
11018}
11019impl Default for ESTIMATOR_STATUS_DATA {
11020 fn default() -> Self {
11021 Self::DEFAULT.clone()
11022 }
11023}
11024impl MessageData for ESTIMATOR_STATUS_DATA {
11025 type Message = MavMessage;
11026 const ID: u32 = 230u32;
11027 const NAME: &'static str = "ESTIMATOR_STATUS";
11028 const EXTRA_CRC: u8 = 163u8;
11029 const ENCODED_LEN: usize = 42usize;
11030 fn deser(
11031 _version: MavlinkVersion,
11032 __input: &[u8],
11033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11034 let avail_len = __input.len();
11035 let mut payload_buf = [0; Self::ENCODED_LEN];
11036 let mut buf = if avail_len < Self::ENCODED_LEN {
11037 payload_buf[0..avail_len].copy_from_slice(__input);
11038 Bytes::new(&payload_buf)
11039 } else {
11040 Bytes::new(__input)
11041 };
11042 let mut __struct = Self::default();
11043 __struct.time_usec = buf.get_u64_le();
11044 __struct.vel_ratio = buf.get_f32_le();
11045 __struct.pos_horiz_ratio = buf.get_f32_le();
11046 __struct.pos_vert_ratio = buf.get_f32_le();
11047 __struct.mag_ratio = buf.get_f32_le();
11048 __struct.hagl_ratio = buf.get_f32_le();
11049 __struct.tas_ratio = buf.get_f32_le();
11050 __struct.pos_horiz_accuracy = buf.get_f32_le();
11051 __struct.pos_vert_accuracy = buf.get_f32_le();
11052 let tmp = buf.get_u16_le();
11053 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11054 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11055 flag_type: "EstimatorStatusFlags",
11056 value: tmp as u32,
11057 })?;
11058 Ok(__struct)
11059 }
11060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11061 let mut __tmp = BytesMut::new(bytes);
11062 #[allow(clippy::absurd_extreme_comparisons)]
11063 #[allow(unused_comparisons)]
11064 if __tmp.remaining() < Self::ENCODED_LEN {
11065 panic!(
11066 "buffer is too small (need {} bytes, but got {})",
11067 Self::ENCODED_LEN,
11068 __tmp.remaining(),
11069 )
11070 }
11071 __tmp.put_u64_le(self.time_usec);
11072 __tmp.put_f32_le(self.vel_ratio);
11073 __tmp.put_f32_le(self.pos_horiz_ratio);
11074 __tmp.put_f32_le(self.pos_vert_ratio);
11075 __tmp.put_f32_le(self.mag_ratio);
11076 __tmp.put_f32_le(self.hagl_ratio);
11077 __tmp.put_f32_le(self.tas_ratio);
11078 __tmp.put_f32_le(self.pos_horiz_accuracy);
11079 __tmp.put_f32_le(self.pos_vert_accuracy);
11080 __tmp.put_u16_le(self.flags.bits());
11081 if matches!(version, MavlinkVersion::V2) {
11082 let len = __tmp.len();
11083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11084 } else {
11085 __tmp.len()
11086 }
11087 }
11088}
11089#[doc = "id: 410"]
11090#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11091#[derive(Debug, Clone, PartialEq)]
11092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11094pub struct EVENT_DATA {
11095 #[doc = "Event ID (as defined in the component metadata)"]
11096 pub id: u32,
11097 #[doc = "Timestamp (time since system boot when the event happened)."]
11098 pub event_time_boot_ms: u32,
11099 #[doc = "Sequence number."]
11100 pub sequence: u16,
11101 #[doc = "Component ID"]
11102 pub destination_component: u8,
11103 #[doc = "System ID"]
11104 pub destination_system: u8,
11105 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11106 pub log_levels: u8,
11107 #[doc = "Arguments (depend on event ID)."]
11108 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11109 pub arguments: [u8; 40],
11110}
11111impl EVENT_DATA {
11112 pub const ENCODED_LEN: usize = 53usize;
11113 pub const DEFAULT: Self = Self {
11114 id: 0_u32,
11115 event_time_boot_ms: 0_u32,
11116 sequence: 0_u16,
11117 destination_component: 0_u8,
11118 destination_system: 0_u8,
11119 log_levels: 0_u8,
11120 arguments: [0_u8; 40usize],
11121 };
11122 #[cfg(feature = "arbitrary")]
11123 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11124 use arbitrary::{Arbitrary, Unstructured};
11125 let mut buf = [0u8; 1024];
11126 rng.fill_bytes(&mut buf);
11127 let mut unstructured = Unstructured::new(&buf);
11128 Self::arbitrary(&mut unstructured).unwrap_or_default()
11129 }
11130}
11131impl Default for EVENT_DATA {
11132 fn default() -> Self {
11133 Self::DEFAULT.clone()
11134 }
11135}
11136impl MessageData for EVENT_DATA {
11137 type Message = MavMessage;
11138 const ID: u32 = 410u32;
11139 const NAME: &'static str = "EVENT";
11140 const EXTRA_CRC: u8 = 160u8;
11141 const ENCODED_LEN: usize = 53usize;
11142 fn deser(
11143 _version: MavlinkVersion,
11144 __input: &[u8],
11145 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11146 let avail_len = __input.len();
11147 let mut payload_buf = [0; Self::ENCODED_LEN];
11148 let mut buf = if avail_len < Self::ENCODED_LEN {
11149 payload_buf[0..avail_len].copy_from_slice(__input);
11150 Bytes::new(&payload_buf)
11151 } else {
11152 Bytes::new(__input)
11153 };
11154 let mut __struct = Self::default();
11155 __struct.id = buf.get_u32_le();
11156 __struct.event_time_boot_ms = buf.get_u32_le();
11157 __struct.sequence = buf.get_u16_le();
11158 __struct.destination_component = buf.get_u8();
11159 __struct.destination_system = buf.get_u8();
11160 __struct.log_levels = buf.get_u8();
11161 for v in &mut __struct.arguments {
11162 let val = buf.get_u8();
11163 *v = val;
11164 }
11165 Ok(__struct)
11166 }
11167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11168 let mut __tmp = BytesMut::new(bytes);
11169 #[allow(clippy::absurd_extreme_comparisons)]
11170 #[allow(unused_comparisons)]
11171 if __tmp.remaining() < Self::ENCODED_LEN {
11172 panic!(
11173 "buffer is too small (need {} bytes, but got {})",
11174 Self::ENCODED_LEN,
11175 __tmp.remaining(),
11176 )
11177 }
11178 __tmp.put_u32_le(self.id);
11179 __tmp.put_u32_le(self.event_time_boot_ms);
11180 __tmp.put_u16_le(self.sequence);
11181 __tmp.put_u8(self.destination_component);
11182 __tmp.put_u8(self.destination_system);
11183 __tmp.put_u8(self.log_levels);
11184 for val in &self.arguments {
11185 __tmp.put_u8(*val);
11186 }
11187 if matches!(version, MavlinkVersion::V2) {
11188 let len = __tmp.len();
11189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11190 } else {
11191 __tmp.len()
11192 }
11193 }
11194}
11195#[doc = "id: 245"]
11196#[doc = "Provides state for additional features."]
11197#[derive(Debug, Clone, PartialEq)]
11198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11200pub struct EXTENDED_SYS_STATE_DATA {
11201 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11202 pub vtol_state: MavVtolState,
11203 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11204 pub landed_state: MavLandedState,
11205}
11206impl EXTENDED_SYS_STATE_DATA {
11207 pub const ENCODED_LEN: usize = 2usize;
11208 pub const DEFAULT: Self = Self {
11209 vtol_state: MavVtolState::DEFAULT,
11210 landed_state: MavLandedState::DEFAULT,
11211 };
11212 #[cfg(feature = "arbitrary")]
11213 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11214 use arbitrary::{Arbitrary, Unstructured};
11215 let mut buf = [0u8; 1024];
11216 rng.fill_bytes(&mut buf);
11217 let mut unstructured = Unstructured::new(&buf);
11218 Self::arbitrary(&mut unstructured).unwrap_or_default()
11219 }
11220}
11221impl Default for EXTENDED_SYS_STATE_DATA {
11222 fn default() -> Self {
11223 Self::DEFAULT.clone()
11224 }
11225}
11226impl MessageData for EXTENDED_SYS_STATE_DATA {
11227 type Message = MavMessage;
11228 const ID: u32 = 245u32;
11229 const NAME: &'static str = "EXTENDED_SYS_STATE";
11230 const EXTRA_CRC: u8 = 130u8;
11231 const ENCODED_LEN: usize = 2usize;
11232 fn deser(
11233 _version: MavlinkVersion,
11234 __input: &[u8],
11235 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11236 let avail_len = __input.len();
11237 let mut payload_buf = [0; Self::ENCODED_LEN];
11238 let mut buf = if avail_len < Self::ENCODED_LEN {
11239 payload_buf[0..avail_len].copy_from_slice(__input);
11240 Bytes::new(&payload_buf)
11241 } else {
11242 Bytes::new(__input)
11243 };
11244 let mut __struct = Self::default();
11245 let tmp = buf.get_u8();
11246 __struct.vtol_state =
11247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11248 enum_type: "MavVtolState",
11249 value: tmp as u32,
11250 })?;
11251 let tmp = buf.get_u8();
11252 __struct.landed_state =
11253 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11254 enum_type: "MavLandedState",
11255 value: tmp as u32,
11256 })?;
11257 Ok(__struct)
11258 }
11259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11260 let mut __tmp = BytesMut::new(bytes);
11261 #[allow(clippy::absurd_extreme_comparisons)]
11262 #[allow(unused_comparisons)]
11263 if __tmp.remaining() < Self::ENCODED_LEN {
11264 panic!(
11265 "buffer is too small (need {} bytes, but got {})",
11266 Self::ENCODED_LEN,
11267 __tmp.remaining(),
11268 )
11269 }
11270 __tmp.put_u8(self.vtol_state as u8);
11271 __tmp.put_u8(self.landed_state as u8);
11272 if matches!(version, MavlinkVersion::V2) {
11273 let len = __tmp.len();
11274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11275 } else {
11276 __tmp.len()
11277 }
11278 }
11279}
11280#[doc = "id: 162"]
11281#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11282#[derive(Debug, Clone, PartialEq)]
11283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11285pub struct FENCE_STATUS_DATA {
11286 #[doc = "Time (since boot) of last breach."]
11287 pub breach_time: u32,
11288 #[doc = "Number of fence breaches."]
11289 pub breach_count: u16,
11290 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11291 pub breach_status: u8,
11292 #[doc = "Last breach type."]
11293 pub breach_type: FenceBreach,
11294 #[doc = "Active action to prevent fence breach"]
11295 #[cfg_attr(feature = "serde", serde(default))]
11296 pub breach_mitigation: FenceMitigate,
11297}
11298impl FENCE_STATUS_DATA {
11299 pub const ENCODED_LEN: usize = 9usize;
11300 pub const DEFAULT: Self = Self {
11301 breach_time: 0_u32,
11302 breach_count: 0_u16,
11303 breach_status: 0_u8,
11304 breach_type: FenceBreach::DEFAULT,
11305 breach_mitigation: FenceMitigate::DEFAULT,
11306 };
11307 #[cfg(feature = "arbitrary")]
11308 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11309 use arbitrary::{Arbitrary, Unstructured};
11310 let mut buf = [0u8; 1024];
11311 rng.fill_bytes(&mut buf);
11312 let mut unstructured = Unstructured::new(&buf);
11313 Self::arbitrary(&mut unstructured).unwrap_or_default()
11314 }
11315}
11316impl Default for FENCE_STATUS_DATA {
11317 fn default() -> Self {
11318 Self::DEFAULT.clone()
11319 }
11320}
11321impl MessageData for FENCE_STATUS_DATA {
11322 type Message = MavMessage;
11323 const ID: u32 = 162u32;
11324 const NAME: &'static str = "FENCE_STATUS";
11325 const EXTRA_CRC: u8 = 189u8;
11326 const ENCODED_LEN: usize = 9usize;
11327 fn deser(
11328 _version: MavlinkVersion,
11329 __input: &[u8],
11330 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11331 let avail_len = __input.len();
11332 let mut payload_buf = [0; Self::ENCODED_LEN];
11333 let mut buf = if avail_len < Self::ENCODED_LEN {
11334 payload_buf[0..avail_len].copy_from_slice(__input);
11335 Bytes::new(&payload_buf)
11336 } else {
11337 Bytes::new(__input)
11338 };
11339 let mut __struct = Self::default();
11340 __struct.breach_time = buf.get_u32_le();
11341 __struct.breach_count = buf.get_u16_le();
11342 __struct.breach_status = buf.get_u8();
11343 let tmp = buf.get_u8();
11344 __struct.breach_type =
11345 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11346 enum_type: "FenceBreach",
11347 value: tmp as u32,
11348 })?;
11349 let tmp = buf.get_u8();
11350 __struct.breach_mitigation =
11351 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11352 enum_type: "FenceMitigate",
11353 value: tmp as u32,
11354 })?;
11355 Ok(__struct)
11356 }
11357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11358 let mut __tmp = BytesMut::new(bytes);
11359 #[allow(clippy::absurd_extreme_comparisons)]
11360 #[allow(unused_comparisons)]
11361 if __tmp.remaining() < Self::ENCODED_LEN {
11362 panic!(
11363 "buffer is too small (need {} bytes, but got {})",
11364 Self::ENCODED_LEN,
11365 __tmp.remaining(),
11366 )
11367 }
11368 __tmp.put_u32_le(self.breach_time);
11369 __tmp.put_u16_le(self.breach_count);
11370 __tmp.put_u8(self.breach_status);
11371 __tmp.put_u8(self.breach_type as u8);
11372 __tmp.put_u8(self.breach_mitigation as u8);
11373 if matches!(version, MavlinkVersion::V2) {
11374 let len = __tmp.len();
11375 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11376 } else {
11377 __tmp.len()
11378 }
11379 }
11380}
11381#[doc = "id: 110"]
11382#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11383#[derive(Debug, Clone, PartialEq)]
11384#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11385#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11386pub struct FILE_TRANSFER_PROTOCOL_DATA {
11387 #[doc = "Network ID (0 for broadcast)"]
11388 pub target_network: u8,
11389 #[doc = "System ID (0 for broadcast)"]
11390 pub target_system: u8,
11391 #[doc = "Component ID (0 for broadcast)"]
11392 pub target_component: u8,
11393 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11394 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11395 pub payload: [u8; 251],
11396}
11397impl FILE_TRANSFER_PROTOCOL_DATA {
11398 pub const ENCODED_LEN: usize = 254usize;
11399 pub const DEFAULT: Self = Self {
11400 target_network: 0_u8,
11401 target_system: 0_u8,
11402 target_component: 0_u8,
11403 payload: [0_u8; 251usize],
11404 };
11405 #[cfg(feature = "arbitrary")]
11406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11407 use arbitrary::{Arbitrary, Unstructured};
11408 let mut buf = [0u8; 1024];
11409 rng.fill_bytes(&mut buf);
11410 let mut unstructured = Unstructured::new(&buf);
11411 Self::arbitrary(&mut unstructured).unwrap_or_default()
11412 }
11413}
11414impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11415 fn default() -> Self {
11416 Self::DEFAULT.clone()
11417 }
11418}
11419impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11420 type Message = MavMessage;
11421 const ID: u32 = 110u32;
11422 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11423 const EXTRA_CRC: u8 = 84u8;
11424 const ENCODED_LEN: usize = 254usize;
11425 fn deser(
11426 _version: MavlinkVersion,
11427 __input: &[u8],
11428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11429 let avail_len = __input.len();
11430 let mut payload_buf = [0; Self::ENCODED_LEN];
11431 let mut buf = if avail_len < Self::ENCODED_LEN {
11432 payload_buf[0..avail_len].copy_from_slice(__input);
11433 Bytes::new(&payload_buf)
11434 } else {
11435 Bytes::new(__input)
11436 };
11437 let mut __struct = Self::default();
11438 __struct.target_network = buf.get_u8();
11439 __struct.target_system = buf.get_u8();
11440 __struct.target_component = buf.get_u8();
11441 for v in &mut __struct.payload {
11442 let val = buf.get_u8();
11443 *v = val;
11444 }
11445 Ok(__struct)
11446 }
11447 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11448 let mut __tmp = BytesMut::new(bytes);
11449 #[allow(clippy::absurd_extreme_comparisons)]
11450 #[allow(unused_comparisons)]
11451 if __tmp.remaining() < Self::ENCODED_LEN {
11452 panic!(
11453 "buffer is too small (need {} bytes, but got {})",
11454 Self::ENCODED_LEN,
11455 __tmp.remaining(),
11456 )
11457 }
11458 __tmp.put_u8(self.target_network);
11459 __tmp.put_u8(self.target_system);
11460 __tmp.put_u8(self.target_component);
11461 for val in &self.payload {
11462 __tmp.put_u8(*val);
11463 }
11464 if matches!(version, MavlinkVersion::V2) {
11465 let len = __tmp.len();
11466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11467 } else {
11468 __tmp.len()
11469 }
11470 }
11471}
11472#[doc = "id: 264"]
11473#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11474#[derive(Debug, Clone, PartialEq)]
11475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11477pub struct FLIGHT_INFORMATION_DATA {
11478 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11479 pub arming_time_utc: u64,
11480 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11481 pub takeoff_time_utc: u64,
11482 #[doc = "Flight number. Note, field is misnamed UUID."]
11483 pub flight_uuid: u64,
11484 #[doc = "Timestamp (time since system boot)."]
11485 pub time_boot_ms: u32,
11486 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11487 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11488 pub landing_time: u32,
11489}
11490impl FLIGHT_INFORMATION_DATA {
11491 pub const ENCODED_LEN: usize = 32usize;
11492 pub const DEFAULT: Self = Self {
11493 arming_time_utc: 0_u64,
11494 takeoff_time_utc: 0_u64,
11495 flight_uuid: 0_u64,
11496 time_boot_ms: 0_u32,
11497 landing_time: 0_u32,
11498 };
11499 #[cfg(feature = "arbitrary")]
11500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11501 use arbitrary::{Arbitrary, Unstructured};
11502 let mut buf = [0u8; 1024];
11503 rng.fill_bytes(&mut buf);
11504 let mut unstructured = Unstructured::new(&buf);
11505 Self::arbitrary(&mut unstructured).unwrap_or_default()
11506 }
11507}
11508impl Default for FLIGHT_INFORMATION_DATA {
11509 fn default() -> Self {
11510 Self::DEFAULT.clone()
11511 }
11512}
11513impl MessageData for FLIGHT_INFORMATION_DATA {
11514 type Message = MavMessage;
11515 const ID: u32 = 264u32;
11516 const NAME: &'static str = "FLIGHT_INFORMATION";
11517 const EXTRA_CRC: u8 = 49u8;
11518 const ENCODED_LEN: usize = 32usize;
11519 fn deser(
11520 _version: MavlinkVersion,
11521 __input: &[u8],
11522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11523 let avail_len = __input.len();
11524 let mut payload_buf = [0; Self::ENCODED_LEN];
11525 let mut buf = if avail_len < Self::ENCODED_LEN {
11526 payload_buf[0..avail_len].copy_from_slice(__input);
11527 Bytes::new(&payload_buf)
11528 } else {
11529 Bytes::new(__input)
11530 };
11531 let mut __struct = Self::default();
11532 __struct.arming_time_utc = buf.get_u64_le();
11533 __struct.takeoff_time_utc = buf.get_u64_le();
11534 __struct.flight_uuid = buf.get_u64_le();
11535 __struct.time_boot_ms = buf.get_u32_le();
11536 __struct.landing_time = buf.get_u32_le();
11537 Ok(__struct)
11538 }
11539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11540 let mut __tmp = BytesMut::new(bytes);
11541 #[allow(clippy::absurd_extreme_comparisons)]
11542 #[allow(unused_comparisons)]
11543 if __tmp.remaining() < Self::ENCODED_LEN {
11544 panic!(
11545 "buffer is too small (need {} bytes, but got {})",
11546 Self::ENCODED_LEN,
11547 __tmp.remaining(),
11548 )
11549 }
11550 __tmp.put_u64_le(self.arming_time_utc);
11551 __tmp.put_u64_le(self.takeoff_time_utc);
11552 __tmp.put_u64_le(self.flight_uuid);
11553 __tmp.put_u32_le(self.time_boot_ms);
11554 __tmp.put_u32_le(self.landing_time);
11555 if matches!(version, MavlinkVersion::V2) {
11556 let len = __tmp.len();
11557 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11558 } else {
11559 __tmp.len()
11560 }
11561 }
11562}
11563#[doc = "id: 144"]
11564#[doc = "Current motion information from a designated system."]
11565#[derive(Debug, Clone, PartialEq)]
11566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11568pub struct FOLLOW_TARGET_DATA {
11569 #[doc = "Timestamp (time since system boot)."]
11570 pub timestamp: u64,
11571 #[doc = "button states or switches of a tracker device"]
11572 pub custom_state: u64,
11573 #[doc = "Latitude (WGS84)"]
11574 pub lat: i32,
11575 #[doc = "Longitude (WGS84)"]
11576 pub lon: i32,
11577 #[doc = "Altitude (MSL)"]
11578 pub alt: f32,
11579 #[doc = "target velocity (0,0,0) for unknown"]
11580 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11581 pub vel: [f32; 3],
11582 #[doc = "linear target acceleration (0,0,0) for unknown"]
11583 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11584 pub acc: [f32; 3],
11585 #[doc = "(0 0 0 0 for unknown)"]
11586 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11587 pub attitude_q: [f32; 4],
11588 #[doc = "(0 0 0 for unknown)"]
11589 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11590 pub rates: [f32; 3],
11591 #[doc = "eph epv"]
11592 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11593 pub position_cov: [f32; 3],
11594 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11595 pub est_capabilities: u8,
11596}
11597impl FOLLOW_TARGET_DATA {
11598 pub const ENCODED_LEN: usize = 93usize;
11599 pub const DEFAULT: Self = Self {
11600 timestamp: 0_u64,
11601 custom_state: 0_u64,
11602 lat: 0_i32,
11603 lon: 0_i32,
11604 alt: 0.0_f32,
11605 vel: [0.0_f32; 3usize],
11606 acc: [0.0_f32; 3usize],
11607 attitude_q: [0.0_f32; 4usize],
11608 rates: [0.0_f32; 3usize],
11609 position_cov: [0.0_f32; 3usize],
11610 est_capabilities: 0_u8,
11611 };
11612 #[cfg(feature = "arbitrary")]
11613 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11614 use arbitrary::{Arbitrary, Unstructured};
11615 let mut buf = [0u8; 1024];
11616 rng.fill_bytes(&mut buf);
11617 let mut unstructured = Unstructured::new(&buf);
11618 Self::arbitrary(&mut unstructured).unwrap_or_default()
11619 }
11620}
11621impl Default for FOLLOW_TARGET_DATA {
11622 fn default() -> Self {
11623 Self::DEFAULT.clone()
11624 }
11625}
11626impl MessageData for FOLLOW_TARGET_DATA {
11627 type Message = MavMessage;
11628 const ID: u32 = 144u32;
11629 const NAME: &'static str = "FOLLOW_TARGET";
11630 const EXTRA_CRC: u8 = 127u8;
11631 const ENCODED_LEN: usize = 93usize;
11632 fn deser(
11633 _version: MavlinkVersion,
11634 __input: &[u8],
11635 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11636 let avail_len = __input.len();
11637 let mut payload_buf = [0; Self::ENCODED_LEN];
11638 let mut buf = if avail_len < Self::ENCODED_LEN {
11639 payload_buf[0..avail_len].copy_from_slice(__input);
11640 Bytes::new(&payload_buf)
11641 } else {
11642 Bytes::new(__input)
11643 };
11644 let mut __struct = Self::default();
11645 __struct.timestamp = buf.get_u64_le();
11646 __struct.custom_state = buf.get_u64_le();
11647 __struct.lat = buf.get_i32_le();
11648 __struct.lon = buf.get_i32_le();
11649 __struct.alt = buf.get_f32_le();
11650 for v in &mut __struct.vel {
11651 let val = buf.get_f32_le();
11652 *v = val;
11653 }
11654 for v in &mut __struct.acc {
11655 let val = buf.get_f32_le();
11656 *v = val;
11657 }
11658 for v in &mut __struct.attitude_q {
11659 let val = buf.get_f32_le();
11660 *v = val;
11661 }
11662 for v in &mut __struct.rates {
11663 let val = buf.get_f32_le();
11664 *v = val;
11665 }
11666 for v in &mut __struct.position_cov {
11667 let val = buf.get_f32_le();
11668 *v = val;
11669 }
11670 __struct.est_capabilities = buf.get_u8();
11671 Ok(__struct)
11672 }
11673 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11674 let mut __tmp = BytesMut::new(bytes);
11675 #[allow(clippy::absurd_extreme_comparisons)]
11676 #[allow(unused_comparisons)]
11677 if __tmp.remaining() < Self::ENCODED_LEN {
11678 panic!(
11679 "buffer is too small (need {} bytes, but got {})",
11680 Self::ENCODED_LEN,
11681 __tmp.remaining(),
11682 )
11683 }
11684 __tmp.put_u64_le(self.timestamp);
11685 __tmp.put_u64_le(self.custom_state);
11686 __tmp.put_i32_le(self.lat);
11687 __tmp.put_i32_le(self.lon);
11688 __tmp.put_f32_le(self.alt);
11689 for val in &self.vel {
11690 __tmp.put_f32_le(*val);
11691 }
11692 for val in &self.acc {
11693 __tmp.put_f32_le(*val);
11694 }
11695 for val in &self.attitude_q {
11696 __tmp.put_f32_le(*val);
11697 }
11698 for val in &self.rates {
11699 __tmp.put_f32_le(*val);
11700 }
11701 for val in &self.position_cov {
11702 __tmp.put_f32_le(*val);
11703 }
11704 __tmp.put_u8(self.est_capabilities);
11705 if matches!(version, MavlinkVersion::V2) {
11706 let len = __tmp.len();
11707 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11708 } else {
11709 __tmp.len()
11710 }
11711 }
11712}
11713#[doc = "id: 371"]
11714#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
11715#[derive(Debug, Clone, PartialEq)]
11716#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11717#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11718pub struct FUEL_STATUS_DATA {
11719 #[doc = "Capacity when full. Must be provided."]
11720 pub maximum_fuel: f32,
11721 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11722 pub consumed_fuel: f32,
11723 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
11724 pub remaining_fuel: f32,
11725 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
11726 pub flow_rate: f32,
11727 #[doc = "Fuel temperature. NaN: field not provided."]
11728 pub temperature: f32,
11729 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
11730 pub fuel_type: MavFuelType,
11731 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
11732 pub id: u8,
11733 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
11734 pub percent_remaining: u8,
11735}
11736impl FUEL_STATUS_DATA {
11737 pub const ENCODED_LEN: usize = 26usize;
11738 pub const DEFAULT: Self = Self {
11739 maximum_fuel: 0.0_f32,
11740 consumed_fuel: 0.0_f32,
11741 remaining_fuel: 0.0_f32,
11742 flow_rate: 0.0_f32,
11743 temperature: 0.0_f32,
11744 fuel_type: MavFuelType::DEFAULT,
11745 id: 0_u8,
11746 percent_remaining: 0_u8,
11747 };
11748 #[cfg(feature = "arbitrary")]
11749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11750 use arbitrary::{Arbitrary, Unstructured};
11751 let mut buf = [0u8; 1024];
11752 rng.fill_bytes(&mut buf);
11753 let mut unstructured = Unstructured::new(&buf);
11754 Self::arbitrary(&mut unstructured).unwrap_or_default()
11755 }
11756}
11757impl Default for FUEL_STATUS_DATA {
11758 fn default() -> Self {
11759 Self::DEFAULT.clone()
11760 }
11761}
11762impl MessageData for FUEL_STATUS_DATA {
11763 type Message = MavMessage;
11764 const ID: u32 = 371u32;
11765 const NAME: &'static str = "FUEL_STATUS";
11766 const EXTRA_CRC: u8 = 10u8;
11767 const ENCODED_LEN: usize = 26usize;
11768 fn deser(
11769 _version: MavlinkVersion,
11770 __input: &[u8],
11771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11772 let avail_len = __input.len();
11773 let mut payload_buf = [0; Self::ENCODED_LEN];
11774 let mut buf = if avail_len < Self::ENCODED_LEN {
11775 payload_buf[0..avail_len].copy_from_slice(__input);
11776 Bytes::new(&payload_buf)
11777 } else {
11778 Bytes::new(__input)
11779 };
11780 let mut __struct = Self::default();
11781 __struct.maximum_fuel = buf.get_f32_le();
11782 __struct.consumed_fuel = buf.get_f32_le();
11783 __struct.remaining_fuel = buf.get_f32_le();
11784 __struct.flow_rate = buf.get_f32_le();
11785 __struct.temperature = buf.get_f32_le();
11786 let tmp = buf.get_u32_le();
11787 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
11788 ::mavlink_core::error::ParserError::InvalidEnum {
11789 enum_type: "MavFuelType",
11790 value: tmp as u32,
11791 },
11792 )?;
11793 __struct.id = buf.get_u8();
11794 __struct.percent_remaining = buf.get_u8();
11795 Ok(__struct)
11796 }
11797 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11798 let mut __tmp = BytesMut::new(bytes);
11799 #[allow(clippy::absurd_extreme_comparisons)]
11800 #[allow(unused_comparisons)]
11801 if __tmp.remaining() < Self::ENCODED_LEN {
11802 panic!(
11803 "buffer is too small (need {} bytes, but got {})",
11804 Self::ENCODED_LEN,
11805 __tmp.remaining(),
11806 )
11807 }
11808 __tmp.put_f32_le(self.maximum_fuel);
11809 __tmp.put_f32_le(self.consumed_fuel);
11810 __tmp.put_f32_le(self.remaining_fuel);
11811 __tmp.put_f32_le(self.flow_rate);
11812 __tmp.put_f32_le(self.temperature);
11813 __tmp.put_u32_le(self.fuel_type as u32);
11814 __tmp.put_u8(self.id);
11815 __tmp.put_u8(self.percent_remaining);
11816 if matches!(version, MavlinkVersion::V2) {
11817 let len = __tmp.len();
11818 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11819 } else {
11820 __tmp.len()
11821 }
11822 }
11823}
11824#[doc = "id: 373"]
11825#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
11826#[derive(Debug, Clone, PartialEq)]
11827#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11828#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11829pub struct GENERATOR_STATUS_DATA {
11830 #[doc = "Status flags."]
11831 pub status: MavGeneratorStatusFlag,
11832 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
11833 pub battery_current: f32,
11834 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
11835 pub load_current: f32,
11836 #[doc = "The power being generated. NaN: field not provided"]
11837 pub power_generated: f32,
11838 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
11839 pub bus_voltage: f32,
11840 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
11841 pub bat_current_setpoint: f32,
11842 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
11843 pub runtime: u32,
11844 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
11845 pub time_until_maintenance: i32,
11846 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
11847 pub generator_speed: u16,
11848 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
11849 pub rectifier_temperature: i16,
11850 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
11851 pub generator_temperature: i16,
11852}
11853impl GENERATOR_STATUS_DATA {
11854 pub const ENCODED_LEN: usize = 42usize;
11855 pub const DEFAULT: Self = Self {
11856 status: MavGeneratorStatusFlag::DEFAULT,
11857 battery_current: 0.0_f32,
11858 load_current: 0.0_f32,
11859 power_generated: 0.0_f32,
11860 bus_voltage: 0.0_f32,
11861 bat_current_setpoint: 0.0_f32,
11862 runtime: 0_u32,
11863 time_until_maintenance: 0_i32,
11864 generator_speed: 0_u16,
11865 rectifier_temperature: 0_i16,
11866 generator_temperature: 0_i16,
11867 };
11868 #[cfg(feature = "arbitrary")]
11869 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11870 use arbitrary::{Arbitrary, Unstructured};
11871 let mut buf = [0u8; 1024];
11872 rng.fill_bytes(&mut buf);
11873 let mut unstructured = Unstructured::new(&buf);
11874 Self::arbitrary(&mut unstructured).unwrap_or_default()
11875 }
11876}
11877impl Default for GENERATOR_STATUS_DATA {
11878 fn default() -> Self {
11879 Self::DEFAULT.clone()
11880 }
11881}
11882impl MessageData for GENERATOR_STATUS_DATA {
11883 type Message = MavMessage;
11884 const ID: u32 = 373u32;
11885 const NAME: &'static str = "GENERATOR_STATUS";
11886 const EXTRA_CRC: u8 = 117u8;
11887 const ENCODED_LEN: usize = 42usize;
11888 fn deser(
11889 _version: MavlinkVersion,
11890 __input: &[u8],
11891 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11892 let avail_len = __input.len();
11893 let mut payload_buf = [0; Self::ENCODED_LEN];
11894 let mut buf = if avail_len < Self::ENCODED_LEN {
11895 payload_buf[0..avail_len].copy_from_slice(__input);
11896 Bytes::new(&payload_buf)
11897 } else {
11898 Bytes::new(__input)
11899 };
11900 let mut __struct = Self::default();
11901 let tmp = buf.get_u64_le();
11902 __struct.status = MavGeneratorStatusFlag::from_bits(
11903 tmp & MavGeneratorStatusFlag::all().bits(),
11904 )
11905 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11906 flag_type: "MavGeneratorStatusFlag",
11907 value: tmp as u32,
11908 })?;
11909 __struct.battery_current = buf.get_f32_le();
11910 __struct.load_current = buf.get_f32_le();
11911 __struct.power_generated = buf.get_f32_le();
11912 __struct.bus_voltage = buf.get_f32_le();
11913 __struct.bat_current_setpoint = buf.get_f32_le();
11914 __struct.runtime = buf.get_u32_le();
11915 __struct.time_until_maintenance = buf.get_i32_le();
11916 __struct.generator_speed = buf.get_u16_le();
11917 __struct.rectifier_temperature = buf.get_i16_le();
11918 __struct.generator_temperature = buf.get_i16_le();
11919 Ok(__struct)
11920 }
11921 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11922 let mut __tmp = BytesMut::new(bytes);
11923 #[allow(clippy::absurd_extreme_comparisons)]
11924 #[allow(unused_comparisons)]
11925 if __tmp.remaining() < Self::ENCODED_LEN {
11926 panic!(
11927 "buffer is too small (need {} bytes, but got {})",
11928 Self::ENCODED_LEN,
11929 __tmp.remaining(),
11930 )
11931 }
11932 __tmp.put_u64_le(self.status.bits());
11933 __tmp.put_f32_le(self.battery_current);
11934 __tmp.put_f32_le(self.load_current);
11935 __tmp.put_f32_le(self.power_generated);
11936 __tmp.put_f32_le(self.bus_voltage);
11937 __tmp.put_f32_le(self.bat_current_setpoint);
11938 __tmp.put_u32_le(self.runtime);
11939 __tmp.put_i32_le(self.time_until_maintenance);
11940 __tmp.put_u16_le(self.generator_speed);
11941 __tmp.put_i16_le(self.rectifier_temperature);
11942 __tmp.put_i16_le(self.generator_temperature);
11943 if matches!(version, MavlinkVersion::V2) {
11944 let len = __tmp.len();
11945 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11946 } else {
11947 __tmp.len()
11948 }
11949 }
11950}
11951#[doc = "id: 285"]
11952#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
11953#[derive(Debug, Clone, PartialEq)]
11954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11956pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11957 #[doc = "Timestamp (time since system boot)."]
11958 pub time_boot_ms: u32,
11959 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
11960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11961 pub q: [f32; 4],
11962 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
11963 pub angular_velocity_x: f32,
11964 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
11965 pub angular_velocity_y: f32,
11966 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
11967 pub angular_velocity_z: f32,
11968 #[doc = "Failure flags (0 for no failure)"]
11969 pub failure_flags: GimbalDeviceErrorFlags,
11970 #[doc = "Current gimbal flags set."]
11971 pub flags: GimbalDeviceFlags,
11972 #[doc = "System ID"]
11973 pub target_system: u8,
11974 #[doc = "Component ID"]
11975 pub target_component: u8,
11976 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
11977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11978 pub delta_yaw: f32,
11979 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
11980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11981 pub delta_yaw_velocity: f32,
11982 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
11983 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11984 pub gimbal_device_id: u8,
11985}
11986impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
11987 pub const ENCODED_LEN: usize = 49usize;
11988 pub const DEFAULT: Self = Self {
11989 time_boot_ms: 0_u32,
11990 q: [0.0_f32; 4usize],
11991 angular_velocity_x: 0.0_f32,
11992 angular_velocity_y: 0.0_f32,
11993 angular_velocity_z: 0.0_f32,
11994 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
11995 flags: GimbalDeviceFlags::DEFAULT,
11996 target_system: 0_u8,
11997 target_component: 0_u8,
11998 delta_yaw: 0.0_f32,
11999 delta_yaw_velocity: 0.0_f32,
12000 gimbal_device_id: 0_u8,
12001 };
12002 #[cfg(feature = "arbitrary")]
12003 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12004 use arbitrary::{Arbitrary, Unstructured};
12005 let mut buf = [0u8; 1024];
12006 rng.fill_bytes(&mut buf);
12007 let mut unstructured = Unstructured::new(&buf);
12008 Self::arbitrary(&mut unstructured).unwrap_or_default()
12009 }
12010}
12011impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12012 fn default() -> Self {
12013 Self::DEFAULT.clone()
12014 }
12015}
12016impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12017 type Message = MavMessage;
12018 const ID: u32 = 285u32;
12019 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12020 const EXTRA_CRC: u8 = 137u8;
12021 const ENCODED_LEN: usize = 49usize;
12022 fn deser(
12023 _version: MavlinkVersion,
12024 __input: &[u8],
12025 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12026 let avail_len = __input.len();
12027 let mut payload_buf = [0; Self::ENCODED_LEN];
12028 let mut buf = if avail_len < Self::ENCODED_LEN {
12029 payload_buf[0..avail_len].copy_from_slice(__input);
12030 Bytes::new(&payload_buf)
12031 } else {
12032 Bytes::new(__input)
12033 };
12034 let mut __struct = Self::default();
12035 __struct.time_boot_ms = buf.get_u32_le();
12036 for v in &mut __struct.q {
12037 let val = buf.get_f32_le();
12038 *v = val;
12039 }
12040 __struct.angular_velocity_x = buf.get_f32_le();
12041 __struct.angular_velocity_y = buf.get_f32_le();
12042 __struct.angular_velocity_z = buf.get_f32_le();
12043 let tmp = buf.get_u32_le();
12044 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12045 tmp & GimbalDeviceErrorFlags::all().bits(),
12046 )
12047 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12048 flag_type: "GimbalDeviceErrorFlags",
12049 value: tmp as u32,
12050 })?;
12051 let tmp = buf.get_u16_le();
12052 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12053 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12054 flag_type: "GimbalDeviceFlags",
12055 value: tmp as u32,
12056 })?;
12057 __struct.target_system = buf.get_u8();
12058 __struct.target_component = buf.get_u8();
12059 __struct.delta_yaw = buf.get_f32_le();
12060 __struct.delta_yaw_velocity = buf.get_f32_le();
12061 __struct.gimbal_device_id = buf.get_u8();
12062 Ok(__struct)
12063 }
12064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12065 let mut __tmp = BytesMut::new(bytes);
12066 #[allow(clippy::absurd_extreme_comparisons)]
12067 #[allow(unused_comparisons)]
12068 if __tmp.remaining() < Self::ENCODED_LEN {
12069 panic!(
12070 "buffer is too small (need {} bytes, but got {})",
12071 Self::ENCODED_LEN,
12072 __tmp.remaining(),
12073 )
12074 }
12075 __tmp.put_u32_le(self.time_boot_ms);
12076 for val in &self.q {
12077 __tmp.put_f32_le(*val);
12078 }
12079 __tmp.put_f32_le(self.angular_velocity_x);
12080 __tmp.put_f32_le(self.angular_velocity_y);
12081 __tmp.put_f32_le(self.angular_velocity_z);
12082 __tmp.put_u32_le(self.failure_flags.bits());
12083 __tmp.put_u16_le(self.flags.bits());
12084 __tmp.put_u8(self.target_system);
12085 __tmp.put_u8(self.target_component);
12086 __tmp.put_f32_le(self.delta_yaw);
12087 __tmp.put_f32_le(self.delta_yaw_velocity);
12088 __tmp.put_u8(self.gimbal_device_id);
12089 if matches!(version, MavlinkVersion::V2) {
12090 let len = __tmp.len();
12091 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12092 } else {
12093 __tmp.len()
12094 }
12095 }
12096}
12097#[doc = "id: 283"]
12098#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12099#[derive(Debug, Clone, PartialEq)]
12100#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12101#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12102pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12103 #[doc = "UID of gimbal hardware (0 if unknown)."]
12104 pub uid: u64,
12105 #[doc = "Timestamp (time since system boot)."]
12106 pub time_boot_ms: u32,
12107 #[doc = "0xff)."]
12108 pub firmware_version: u32,
12109 #[doc = "0xff)."]
12110 pub hardware_version: u32,
12111 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12112 pub roll_min: f32,
12113 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12114 pub roll_max: f32,
12115 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12116 pub pitch_min: f32,
12117 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12118 pub pitch_max: f32,
12119 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12120 pub yaw_min: f32,
12121 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12122 pub yaw_max: f32,
12123 #[doc = "Bitmap of gimbal capability flags."]
12124 pub cap_flags: GimbalDeviceCapFlags,
12125 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12126 pub custom_cap_flags: u16,
12127 #[doc = "Name of the gimbal vendor."]
12128 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12129 pub vendor_name: [u8; 32],
12130 #[doc = "Name of the gimbal model."]
12131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12132 pub model_name: [u8; 32],
12133 #[doc = "Custom name of the gimbal given to it by the user."]
12134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12135 pub custom_name: [u8; 32],
12136 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12137 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12138 pub gimbal_device_id: u8,
12139}
12140impl GIMBAL_DEVICE_INFORMATION_DATA {
12141 pub const ENCODED_LEN: usize = 145usize;
12142 pub const DEFAULT: Self = Self {
12143 uid: 0_u64,
12144 time_boot_ms: 0_u32,
12145 firmware_version: 0_u32,
12146 hardware_version: 0_u32,
12147 roll_min: 0.0_f32,
12148 roll_max: 0.0_f32,
12149 pitch_min: 0.0_f32,
12150 pitch_max: 0.0_f32,
12151 yaw_min: 0.0_f32,
12152 yaw_max: 0.0_f32,
12153 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12154 custom_cap_flags: 0_u16,
12155 vendor_name: [0_u8; 32usize],
12156 model_name: [0_u8; 32usize],
12157 custom_name: [0_u8; 32usize],
12158 gimbal_device_id: 0_u8,
12159 };
12160 #[cfg(feature = "arbitrary")]
12161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12162 use arbitrary::{Arbitrary, Unstructured};
12163 let mut buf = [0u8; 1024];
12164 rng.fill_bytes(&mut buf);
12165 let mut unstructured = Unstructured::new(&buf);
12166 Self::arbitrary(&mut unstructured).unwrap_or_default()
12167 }
12168}
12169impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12170 fn default() -> Self {
12171 Self::DEFAULT.clone()
12172 }
12173}
12174impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12175 type Message = MavMessage;
12176 const ID: u32 = 283u32;
12177 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12178 const EXTRA_CRC: u8 = 74u8;
12179 const ENCODED_LEN: usize = 145usize;
12180 fn deser(
12181 _version: MavlinkVersion,
12182 __input: &[u8],
12183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12184 let avail_len = __input.len();
12185 let mut payload_buf = [0; Self::ENCODED_LEN];
12186 let mut buf = if avail_len < Self::ENCODED_LEN {
12187 payload_buf[0..avail_len].copy_from_slice(__input);
12188 Bytes::new(&payload_buf)
12189 } else {
12190 Bytes::new(__input)
12191 };
12192 let mut __struct = Self::default();
12193 __struct.uid = buf.get_u64_le();
12194 __struct.time_boot_ms = buf.get_u32_le();
12195 __struct.firmware_version = buf.get_u32_le();
12196 __struct.hardware_version = buf.get_u32_le();
12197 __struct.roll_min = buf.get_f32_le();
12198 __struct.roll_max = buf.get_f32_le();
12199 __struct.pitch_min = buf.get_f32_le();
12200 __struct.pitch_max = buf.get_f32_le();
12201 __struct.yaw_min = buf.get_f32_le();
12202 __struct.yaw_max = buf.get_f32_le();
12203 let tmp = buf.get_u16_le();
12204 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12205 tmp & GimbalDeviceCapFlags::all().bits(),
12206 )
12207 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12208 flag_type: "GimbalDeviceCapFlags",
12209 value: tmp as u32,
12210 })?;
12211 __struct.custom_cap_flags = buf.get_u16_le();
12212 for v in &mut __struct.vendor_name {
12213 let val = buf.get_u8();
12214 *v = val;
12215 }
12216 for v in &mut __struct.model_name {
12217 let val = buf.get_u8();
12218 *v = val;
12219 }
12220 for v in &mut __struct.custom_name {
12221 let val = buf.get_u8();
12222 *v = val;
12223 }
12224 __struct.gimbal_device_id = buf.get_u8();
12225 Ok(__struct)
12226 }
12227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12228 let mut __tmp = BytesMut::new(bytes);
12229 #[allow(clippy::absurd_extreme_comparisons)]
12230 #[allow(unused_comparisons)]
12231 if __tmp.remaining() < Self::ENCODED_LEN {
12232 panic!(
12233 "buffer is too small (need {} bytes, but got {})",
12234 Self::ENCODED_LEN,
12235 __tmp.remaining(),
12236 )
12237 }
12238 __tmp.put_u64_le(self.uid);
12239 __tmp.put_u32_le(self.time_boot_ms);
12240 __tmp.put_u32_le(self.firmware_version);
12241 __tmp.put_u32_le(self.hardware_version);
12242 __tmp.put_f32_le(self.roll_min);
12243 __tmp.put_f32_le(self.roll_max);
12244 __tmp.put_f32_le(self.pitch_min);
12245 __tmp.put_f32_le(self.pitch_max);
12246 __tmp.put_f32_le(self.yaw_min);
12247 __tmp.put_f32_le(self.yaw_max);
12248 __tmp.put_u16_le(self.cap_flags.bits());
12249 __tmp.put_u16_le(self.custom_cap_flags);
12250 for val in &self.vendor_name {
12251 __tmp.put_u8(*val);
12252 }
12253 for val in &self.model_name {
12254 __tmp.put_u8(*val);
12255 }
12256 for val in &self.custom_name {
12257 __tmp.put_u8(*val);
12258 }
12259 __tmp.put_u8(self.gimbal_device_id);
12260 if matches!(version, MavlinkVersion::V2) {
12261 let len = __tmp.len();
12262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12263 } else {
12264 __tmp.len()
12265 }
12266 }
12267}
12268#[doc = "id: 284"]
12269#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12270#[derive(Debug, Clone, PartialEq)]
12271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12273pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12274 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12275 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12276 pub q: [f32; 4],
12277 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12278 pub angular_velocity_x: f32,
12279 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12280 pub angular_velocity_y: f32,
12281 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12282 pub angular_velocity_z: f32,
12283 #[doc = "Low level gimbal flags."]
12284 pub flags: GimbalDeviceFlags,
12285 #[doc = "System ID"]
12286 pub target_system: u8,
12287 #[doc = "Component ID"]
12288 pub target_component: u8,
12289}
12290impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12291 pub const ENCODED_LEN: usize = 32usize;
12292 pub const DEFAULT: Self = Self {
12293 q: [0.0_f32; 4usize],
12294 angular_velocity_x: 0.0_f32,
12295 angular_velocity_y: 0.0_f32,
12296 angular_velocity_z: 0.0_f32,
12297 flags: GimbalDeviceFlags::DEFAULT,
12298 target_system: 0_u8,
12299 target_component: 0_u8,
12300 };
12301 #[cfg(feature = "arbitrary")]
12302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12303 use arbitrary::{Arbitrary, Unstructured};
12304 let mut buf = [0u8; 1024];
12305 rng.fill_bytes(&mut buf);
12306 let mut unstructured = Unstructured::new(&buf);
12307 Self::arbitrary(&mut unstructured).unwrap_or_default()
12308 }
12309}
12310impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12311 fn default() -> Self {
12312 Self::DEFAULT.clone()
12313 }
12314}
12315impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12316 type Message = MavMessage;
12317 const ID: u32 = 284u32;
12318 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12319 const EXTRA_CRC: u8 = 99u8;
12320 const ENCODED_LEN: usize = 32usize;
12321 fn deser(
12322 _version: MavlinkVersion,
12323 __input: &[u8],
12324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12325 let avail_len = __input.len();
12326 let mut payload_buf = [0; Self::ENCODED_LEN];
12327 let mut buf = if avail_len < Self::ENCODED_LEN {
12328 payload_buf[0..avail_len].copy_from_slice(__input);
12329 Bytes::new(&payload_buf)
12330 } else {
12331 Bytes::new(__input)
12332 };
12333 let mut __struct = Self::default();
12334 for v in &mut __struct.q {
12335 let val = buf.get_f32_le();
12336 *v = val;
12337 }
12338 __struct.angular_velocity_x = buf.get_f32_le();
12339 __struct.angular_velocity_y = buf.get_f32_le();
12340 __struct.angular_velocity_z = buf.get_f32_le();
12341 let tmp = buf.get_u16_le();
12342 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12343 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12344 flag_type: "GimbalDeviceFlags",
12345 value: tmp as u32,
12346 })?;
12347 __struct.target_system = buf.get_u8();
12348 __struct.target_component = buf.get_u8();
12349 Ok(__struct)
12350 }
12351 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12352 let mut __tmp = BytesMut::new(bytes);
12353 #[allow(clippy::absurd_extreme_comparisons)]
12354 #[allow(unused_comparisons)]
12355 if __tmp.remaining() < Self::ENCODED_LEN {
12356 panic!(
12357 "buffer is too small (need {} bytes, but got {})",
12358 Self::ENCODED_LEN,
12359 __tmp.remaining(),
12360 )
12361 }
12362 for val in &self.q {
12363 __tmp.put_f32_le(*val);
12364 }
12365 __tmp.put_f32_le(self.angular_velocity_x);
12366 __tmp.put_f32_le(self.angular_velocity_y);
12367 __tmp.put_f32_le(self.angular_velocity_z);
12368 __tmp.put_u16_le(self.flags.bits());
12369 __tmp.put_u8(self.target_system);
12370 __tmp.put_u8(self.target_component);
12371 if matches!(version, MavlinkVersion::V2) {
12372 let len = __tmp.len();
12373 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12374 } else {
12375 __tmp.len()
12376 }
12377 }
12378}
12379#[doc = "id: 280"]
12380#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12381#[derive(Debug, Clone, PartialEq)]
12382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12384pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12385 #[doc = "Timestamp (time since system boot)."]
12386 pub time_boot_ms: u32,
12387 #[doc = "Bitmap of gimbal capability flags."]
12388 pub cap_flags: GimbalManagerCapFlags,
12389 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12390 pub roll_min: f32,
12391 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12392 pub roll_max: f32,
12393 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12394 pub pitch_min: f32,
12395 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12396 pub pitch_max: f32,
12397 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12398 pub yaw_min: f32,
12399 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12400 pub yaw_max: f32,
12401 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12402 pub gimbal_device_id: u8,
12403}
12404impl GIMBAL_MANAGER_INFORMATION_DATA {
12405 pub const ENCODED_LEN: usize = 33usize;
12406 pub const DEFAULT: Self = Self {
12407 time_boot_ms: 0_u32,
12408 cap_flags: GimbalManagerCapFlags::DEFAULT,
12409 roll_min: 0.0_f32,
12410 roll_max: 0.0_f32,
12411 pitch_min: 0.0_f32,
12412 pitch_max: 0.0_f32,
12413 yaw_min: 0.0_f32,
12414 yaw_max: 0.0_f32,
12415 gimbal_device_id: 0_u8,
12416 };
12417 #[cfg(feature = "arbitrary")]
12418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12419 use arbitrary::{Arbitrary, Unstructured};
12420 let mut buf = [0u8; 1024];
12421 rng.fill_bytes(&mut buf);
12422 let mut unstructured = Unstructured::new(&buf);
12423 Self::arbitrary(&mut unstructured).unwrap_or_default()
12424 }
12425}
12426impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12427 fn default() -> Self {
12428 Self::DEFAULT.clone()
12429 }
12430}
12431impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12432 type Message = MavMessage;
12433 const ID: u32 = 280u32;
12434 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12435 const EXTRA_CRC: u8 = 70u8;
12436 const ENCODED_LEN: usize = 33usize;
12437 fn deser(
12438 _version: MavlinkVersion,
12439 __input: &[u8],
12440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12441 let avail_len = __input.len();
12442 let mut payload_buf = [0; Self::ENCODED_LEN];
12443 let mut buf = if avail_len < Self::ENCODED_LEN {
12444 payload_buf[0..avail_len].copy_from_slice(__input);
12445 Bytes::new(&payload_buf)
12446 } else {
12447 Bytes::new(__input)
12448 };
12449 let mut __struct = Self::default();
12450 __struct.time_boot_ms = buf.get_u32_le();
12451 let tmp = buf.get_u32_le();
12452 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12453 tmp & GimbalManagerCapFlags::all().bits(),
12454 )
12455 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12456 flag_type: "GimbalManagerCapFlags",
12457 value: tmp as u32,
12458 })?;
12459 __struct.roll_min = buf.get_f32_le();
12460 __struct.roll_max = buf.get_f32_le();
12461 __struct.pitch_min = buf.get_f32_le();
12462 __struct.pitch_max = buf.get_f32_le();
12463 __struct.yaw_min = buf.get_f32_le();
12464 __struct.yaw_max = buf.get_f32_le();
12465 __struct.gimbal_device_id = buf.get_u8();
12466 Ok(__struct)
12467 }
12468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12469 let mut __tmp = BytesMut::new(bytes);
12470 #[allow(clippy::absurd_extreme_comparisons)]
12471 #[allow(unused_comparisons)]
12472 if __tmp.remaining() < Self::ENCODED_LEN {
12473 panic!(
12474 "buffer is too small (need {} bytes, but got {})",
12475 Self::ENCODED_LEN,
12476 __tmp.remaining(),
12477 )
12478 }
12479 __tmp.put_u32_le(self.time_boot_ms);
12480 __tmp.put_u32_le(self.cap_flags.bits());
12481 __tmp.put_f32_le(self.roll_min);
12482 __tmp.put_f32_le(self.roll_max);
12483 __tmp.put_f32_le(self.pitch_min);
12484 __tmp.put_f32_le(self.pitch_max);
12485 __tmp.put_f32_le(self.yaw_min);
12486 __tmp.put_f32_le(self.yaw_max);
12487 __tmp.put_u8(self.gimbal_device_id);
12488 if matches!(version, MavlinkVersion::V2) {
12489 let len = __tmp.len();
12490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12491 } else {
12492 __tmp.len()
12493 }
12494 }
12495}
12496#[doc = "id: 282"]
12497#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12498#[derive(Debug, Clone, PartialEq)]
12499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12501pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12502 #[doc = "High level gimbal manager flags to use."]
12503 pub flags: GimbalManagerFlags,
12504 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12505 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12506 pub q: [f32; 4],
12507 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12508 pub angular_velocity_x: f32,
12509 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12510 pub angular_velocity_y: f32,
12511 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12512 pub angular_velocity_z: f32,
12513 #[doc = "System ID"]
12514 pub target_system: u8,
12515 #[doc = "Component ID"]
12516 pub target_component: u8,
12517 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12518 pub gimbal_device_id: u8,
12519}
12520impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12521 pub const ENCODED_LEN: usize = 35usize;
12522 pub const DEFAULT: Self = Self {
12523 flags: GimbalManagerFlags::DEFAULT,
12524 q: [0.0_f32; 4usize],
12525 angular_velocity_x: 0.0_f32,
12526 angular_velocity_y: 0.0_f32,
12527 angular_velocity_z: 0.0_f32,
12528 target_system: 0_u8,
12529 target_component: 0_u8,
12530 gimbal_device_id: 0_u8,
12531 };
12532 #[cfg(feature = "arbitrary")]
12533 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12534 use arbitrary::{Arbitrary, Unstructured};
12535 let mut buf = [0u8; 1024];
12536 rng.fill_bytes(&mut buf);
12537 let mut unstructured = Unstructured::new(&buf);
12538 Self::arbitrary(&mut unstructured).unwrap_or_default()
12539 }
12540}
12541impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12542 fn default() -> Self {
12543 Self::DEFAULT.clone()
12544 }
12545}
12546impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12547 type Message = MavMessage;
12548 const ID: u32 = 282u32;
12549 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12550 const EXTRA_CRC: u8 = 123u8;
12551 const ENCODED_LEN: usize = 35usize;
12552 fn deser(
12553 _version: MavlinkVersion,
12554 __input: &[u8],
12555 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12556 let avail_len = __input.len();
12557 let mut payload_buf = [0; Self::ENCODED_LEN];
12558 let mut buf = if avail_len < Self::ENCODED_LEN {
12559 payload_buf[0..avail_len].copy_from_slice(__input);
12560 Bytes::new(&payload_buf)
12561 } else {
12562 Bytes::new(__input)
12563 };
12564 let mut __struct = Self::default();
12565 let tmp = buf.get_u32_le();
12566 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12567 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12568 flag_type: "GimbalManagerFlags",
12569 value: tmp as u32,
12570 })?;
12571 for v in &mut __struct.q {
12572 let val = buf.get_f32_le();
12573 *v = val;
12574 }
12575 __struct.angular_velocity_x = buf.get_f32_le();
12576 __struct.angular_velocity_y = buf.get_f32_le();
12577 __struct.angular_velocity_z = buf.get_f32_le();
12578 __struct.target_system = buf.get_u8();
12579 __struct.target_component = buf.get_u8();
12580 __struct.gimbal_device_id = buf.get_u8();
12581 Ok(__struct)
12582 }
12583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12584 let mut __tmp = BytesMut::new(bytes);
12585 #[allow(clippy::absurd_extreme_comparisons)]
12586 #[allow(unused_comparisons)]
12587 if __tmp.remaining() < Self::ENCODED_LEN {
12588 panic!(
12589 "buffer is too small (need {} bytes, but got {})",
12590 Self::ENCODED_LEN,
12591 __tmp.remaining(),
12592 )
12593 }
12594 __tmp.put_u32_le(self.flags.bits());
12595 for val in &self.q {
12596 __tmp.put_f32_le(*val);
12597 }
12598 __tmp.put_f32_le(self.angular_velocity_x);
12599 __tmp.put_f32_le(self.angular_velocity_y);
12600 __tmp.put_f32_le(self.angular_velocity_z);
12601 __tmp.put_u8(self.target_system);
12602 __tmp.put_u8(self.target_component);
12603 __tmp.put_u8(self.gimbal_device_id);
12604 if matches!(version, MavlinkVersion::V2) {
12605 let len = __tmp.len();
12606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12607 } else {
12608 __tmp.len()
12609 }
12610 }
12611}
12612#[doc = "id: 288"]
12613#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12614#[derive(Debug, Clone, PartialEq)]
12615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12617pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12618 #[doc = "High level gimbal manager flags."]
12619 pub flags: GimbalManagerFlags,
12620 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12621 pub pitch: f32,
12622 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12623 pub yaw: f32,
12624 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12625 pub pitch_rate: f32,
12626 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12627 pub yaw_rate: f32,
12628 #[doc = "System ID"]
12629 pub target_system: u8,
12630 #[doc = "Component ID"]
12631 pub target_component: u8,
12632 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12633 pub gimbal_device_id: u8,
12634}
12635impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12636 pub const ENCODED_LEN: usize = 23usize;
12637 pub const DEFAULT: Self = Self {
12638 flags: GimbalManagerFlags::DEFAULT,
12639 pitch: 0.0_f32,
12640 yaw: 0.0_f32,
12641 pitch_rate: 0.0_f32,
12642 yaw_rate: 0.0_f32,
12643 target_system: 0_u8,
12644 target_component: 0_u8,
12645 gimbal_device_id: 0_u8,
12646 };
12647 #[cfg(feature = "arbitrary")]
12648 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12649 use arbitrary::{Arbitrary, Unstructured};
12650 let mut buf = [0u8; 1024];
12651 rng.fill_bytes(&mut buf);
12652 let mut unstructured = Unstructured::new(&buf);
12653 Self::arbitrary(&mut unstructured).unwrap_or_default()
12654 }
12655}
12656impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12657 fn default() -> Self {
12658 Self::DEFAULT.clone()
12659 }
12660}
12661impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12662 type Message = MavMessage;
12663 const ID: u32 = 288u32;
12664 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
12665 const EXTRA_CRC: u8 = 20u8;
12666 const ENCODED_LEN: usize = 23usize;
12667 fn deser(
12668 _version: MavlinkVersion,
12669 __input: &[u8],
12670 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12671 let avail_len = __input.len();
12672 let mut payload_buf = [0; Self::ENCODED_LEN];
12673 let mut buf = if avail_len < Self::ENCODED_LEN {
12674 payload_buf[0..avail_len].copy_from_slice(__input);
12675 Bytes::new(&payload_buf)
12676 } else {
12677 Bytes::new(__input)
12678 };
12679 let mut __struct = Self::default();
12680 let tmp = buf.get_u32_le();
12681 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12682 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12683 flag_type: "GimbalManagerFlags",
12684 value: tmp as u32,
12685 })?;
12686 __struct.pitch = buf.get_f32_le();
12687 __struct.yaw = buf.get_f32_le();
12688 __struct.pitch_rate = buf.get_f32_le();
12689 __struct.yaw_rate = buf.get_f32_le();
12690 __struct.target_system = buf.get_u8();
12691 __struct.target_component = buf.get_u8();
12692 __struct.gimbal_device_id = buf.get_u8();
12693 Ok(__struct)
12694 }
12695 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12696 let mut __tmp = BytesMut::new(bytes);
12697 #[allow(clippy::absurd_extreme_comparisons)]
12698 #[allow(unused_comparisons)]
12699 if __tmp.remaining() < Self::ENCODED_LEN {
12700 panic!(
12701 "buffer is too small (need {} bytes, but got {})",
12702 Self::ENCODED_LEN,
12703 __tmp.remaining(),
12704 )
12705 }
12706 __tmp.put_u32_le(self.flags.bits());
12707 __tmp.put_f32_le(self.pitch);
12708 __tmp.put_f32_le(self.yaw);
12709 __tmp.put_f32_le(self.pitch_rate);
12710 __tmp.put_f32_le(self.yaw_rate);
12711 __tmp.put_u8(self.target_system);
12712 __tmp.put_u8(self.target_component);
12713 __tmp.put_u8(self.gimbal_device_id);
12714 if matches!(version, MavlinkVersion::V2) {
12715 let len = __tmp.len();
12716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12717 } else {
12718 __tmp.len()
12719 }
12720 }
12721}
12722#[doc = "id: 287"]
12723#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12724#[derive(Debug, Clone, PartialEq)]
12725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12727pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12728 #[doc = "High level gimbal manager flags to use."]
12729 pub flags: GimbalManagerFlags,
12730 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12731 pub pitch: f32,
12732 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12733 pub yaw: f32,
12734 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12735 pub pitch_rate: f32,
12736 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12737 pub yaw_rate: f32,
12738 #[doc = "System ID"]
12739 pub target_system: u8,
12740 #[doc = "Component ID"]
12741 pub target_component: u8,
12742 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12743 pub gimbal_device_id: u8,
12744}
12745impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12746 pub const ENCODED_LEN: usize = 23usize;
12747 pub const DEFAULT: Self = Self {
12748 flags: GimbalManagerFlags::DEFAULT,
12749 pitch: 0.0_f32,
12750 yaw: 0.0_f32,
12751 pitch_rate: 0.0_f32,
12752 yaw_rate: 0.0_f32,
12753 target_system: 0_u8,
12754 target_component: 0_u8,
12755 gimbal_device_id: 0_u8,
12756 };
12757 #[cfg(feature = "arbitrary")]
12758 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12759 use arbitrary::{Arbitrary, Unstructured};
12760 let mut buf = [0u8; 1024];
12761 rng.fill_bytes(&mut buf);
12762 let mut unstructured = Unstructured::new(&buf);
12763 Self::arbitrary(&mut unstructured).unwrap_or_default()
12764 }
12765}
12766impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12767 fn default() -> Self {
12768 Self::DEFAULT.clone()
12769 }
12770}
12771impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12772 type Message = MavMessage;
12773 const ID: u32 = 287u32;
12774 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12775 const EXTRA_CRC: u8 = 1u8;
12776 const ENCODED_LEN: usize = 23usize;
12777 fn deser(
12778 _version: MavlinkVersion,
12779 __input: &[u8],
12780 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12781 let avail_len = __input.len();
12782 let mut payload_buf = [0; Self::ENCODED_LEN];
12783 let mut buf = if avail_len < Self::ENCODED_LEN {
12784 payload_buf[0..avail_len].copy_from_slice(__input);
12785 Bytes::new(&payload_buf)
12786 } else {
12787 Bytes::new(__input)
12788 };
12789 let mut __struct = Self::default();
12790 let tmp = buf.get_u32_le();
12791 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12792 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12793 flag_type: "GimbalManagerFlags",
12794 value: tmp as u32,
12795 })?;
12796 __struct.pitch = buf.get_f32_le();
12797 __struct.yaw = buf.get_f32_le();
12798 __struct.pitch_rate = buf.get_f32_le();
12799 __struct.yaw_rate = buf.get_f32_le();
12800 __struct.target_system = buf.get_u8();
12801 __struct.target_component = buf.get_u8();
12802 __struct.gimbal_device_id = buf.get_u8();
12803 Ok(__struct)
12804 }
12805 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12806 let mut __tmp = BytesMut::new(bytes);
12807 #[allow(clippy::absurd_extreme_comparisons)]
12808 #[allow(unused_comparisons)]
12809 if __tmp.remaining() < Self::ENCODED_LEN {
12810 panic!(
12811 "buffer is too small (need {} bytes, but got {})",
12812 Self::ENCODED_LEN,
12813 __tmp.remaining(),
12814 )
12815 }
12816 __tmp.put_u32_le(self.flags.bits());
12817 __tmp.put_f32_le(self.pitch);
12818 __tmp.put_f32_le(self.yaw);
12819 __tmp.put_f32_le(self.pitch_rate);
12820 __tmp.put_f32_le(self.yaw_rate);
12821 __tmp.put_u8(self.target_system);
12822 __tmp.put_u8(self.target_component);
12823 __tmp.put_u8(self.gimbal_device_id);
12824 if matches!(version, MavlinkVersion::V2) {
12825 let len = __tmp.len();
12826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12827 } else {
12828 __tmp.len()
12829 }
12830 }
12831}
12832#[doc = "id: 281"]
12833#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
12834#[derive(Debug, Clone, PartialEq)]
12835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12837pub struct GIMBAL_MANAGER_STATUS_DATA {
12838 #[doc = "Timestamp (time since system boot)."]
12839 pub time_boot_ms: u32,
12840 #[doc = "High level gimbal manager flags currently applied."]
12841 pub flags: GimbalManagerFlags,
12842 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12843 pub gimbal_device_id: u8,
12844 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
12845 pub primary_control_sysid: u8,
12846 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
12847 pub primary_control_compid: u8,
12848 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
12849 pub secondary_control_sysid: u8,
12850 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
12851 pub secondary_control_compid: u8,
12852}
12853impl GIMBAL_MANAGER_STATUS_DATA {
12854 pub const ENCODED_LEN: usize = 13usize;
12855 pub const DEFAULT: Self = Self {
12856 time_boot_ms: 0_u32,
12857 flags: GimbalManagerFlags::DEFAULT,
12858 gimbal_device_id: 0_u8,
12859 primary_control_sysid: 0_u8,
12860 primary_control_compid: 0_u8,
12861 secondary_control_sysid: 0_u8,
12862 secondary_control_compid: 0_u8,
12863 };
12864 #[cfg(feature = "arbitrary")]
12865 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12866 use arbitrary::{Arbitrary, Unstructured};
12867 let mut buf = [0u8; 1024];
12868 rng.fill_bytes(&mut buf);
12869 let mut unstructured = Unstructured::new(&buf);
12870 Self::arbitrary(&mut unstructured).unwrap_or_default()
12871 }
12872}
12873impl Default for GIMBAL_MANAGER_STATUS_DATA {
12874 fn default() -> Self {
12875 Self::DEFAULT.clone()
12876 }
12877}
12878impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
12879 type Message = MavMessage;
12880 const ID: u32 = 281u32;
12881 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
12882 const EXTRA_CRC: u8 = 48u8;
12883 const ENCODED_LEN: usize = 13usize;
12884 fn deser(
12885 _version: MavlinkVersion,
12886 __input: &[u8],
12887 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12888 let avail_len = __input.len();
12889 let mut payload_buf = [0; Self::ENCODED_LEN];
12890 let mut buf = if avail_len < Self::ENCODED_LEN {
12891 payload_buf[0..avail_len].copy_from_slice(__input);
12892 Bytes::new(&payload_buf)
12893 } else {
12894 Bytes::new(__input)
12895 };
12896 let mut __struct = Self::default();
12897 __struct.time_boot_ms = buf.get_u32_le();
12898 let tmp = buf.get_u32_le();
12899 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12900 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12901 flag_type: "GimbalManagerFlags",
12902 value: tmp as u32,
12903 })?;
12904 __struct.gimbal_device_id = buf.get_u8();
12905 __struct.primary_control_sysid = buf.get_u8();
12906 __struct.primary_control_compid = buf.get_u8();
12907 __struct.secondary_control_sysid = buf.get_u8();
12908 __struct.secondary_control_compid = buf.get_u8();
12909 Ok(__struct)
12910 }
12911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12912 let mut __tmp = BytesMut::new(bytes);
12913 #[allow(clippy::absurd_extreme_comparisons)]
12914 #[allow(unused_comparisons)]
12915 if __tmp.remaining() < Self::ENCODED_LEN {
12916 panic!(
12917 "buffer is too small (need {} bytes, but got {})",
12918 Self::ENCODED_LEN,
12919 __tmp.remaining(),
12920 )
12921 }
12922 __tmp.put_u32_le(self.time_boot_ms);
12923 __tmp.put_u32_le(self.flags.bits());
12924 __tmp.put_u8(self.gimbal_device_id);
12925 __tmp.put_u8(self.primary_control_sysid);
12926 __tmp.put_u8(self.primary_control_compid);
12927 __tmp.put_u8(self.secondary_control_sysid);
12928 __tmp.put_u8(self.secondary_control_compid);
12929 if matches!(version, MavlinkVersion::V2) {
12930 let len = __tmp.len();
12931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12932 } else {
12933 __tmp.len()
12934 }
12935 }
12936}
12937#[doc = "id: 33"]
12938#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
12939#[derive(Debug, Clone, PartialEq)]
12940#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12941#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12942pub struct GLOBAL_POSITION_INT_DATA {
12943 #[doc = "Timestamp (time since system boot)."]
12944 pub time_boot_ms: u32,
12945 #[doc = "Latitude, expressed"]
12946 pub lat: i32,
12947 #[doc = "Longitude, expressed"]
12948 pub lon: i32,
12949 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
12950 pub alt: i32,
12951 #[doc = "Altitude above home"]
12952 pub relative_alt: i32,
12953 #[doc = "Ground X Speed (Latitude, positive north)"]
12954 pub vx: i16,
12955 #[doc = "Ground Y Speed (Longitude, positive east)"]
12956 pub vy: i16,
12957 #[doc = "Ground Z Speed (Altitude, positive down)"]
12958 pub vz: i16,
12959 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
12960 pub hdg: u16,
12961}
12962impl GLOBAL_POSITION_INT_DATA {
12963 pub const ENCODED_LEN: usize = 28usize;
12964 pub const DEFAULT: Self = Self {
12965 time_boot_ms: 0_u32,
12966 lat: 0_i32,
12967 lon: 0_i32,
12968 alt: 0_i32,
12969 relative_alt: 0_i32,
12970 vx: 0_i16,
12971 vy: 0_i16,
12972 vz: 0_i16,
12973 hdg: 0_u16,
12974 };
12975 #[cfg(feature = "arbitrary")]
12976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12977 use arbitrary::{Arbitrary, Unstructured};
12978 let mut buf = [0u8; 1024];
12979 rng.fill_bytes(&mut buf);
12980 let mut unstructured = Unstructured::new(&buf);
12981 Self::arbitrary(&mut unstructured).unwrap_or_default()
12982 }
12983}
12984impl Default for GLOBAL_POSITION_INT_DATA {
12985 fn default() -> Self {
12986 Self::DEFAULT.clone()
12987 }
12988}
12989impl MessageData for GLOBAL_POSITION_INT_DATA {
12990 type Message = MavMessage;
12991 const ID: u32 = 33u32;
12992 const NAME: &'static str = "GLOBAL_POSITION_INT";
12993 const EXTRA_CRC: u8 = 104u8;
12994 const ENCODED_LEN: usize = 28usize;
12995 fn deser(
12996 _version: MavlinkVersion,
12997 __input: &[u8],
12998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12999 let avail_len = __input.len();
13000 let mut payload_buf = [0; Self::ENCODED_LEN];
13001 let mut buf = if avail_len < Self::ENCODED_LEN {
13002 payload_buf[0..avail_len].copy_from_slice(__input);
13003 Bytes::new(&payload_buf)
13004 } else {
13005 Bytes::new(__input)
13006 };
13007 let mut __struct = Self::default();
13008 __struct.time_boot_ms = buf.get_u32_le();
13009 __struct.lat = buf.get_i32_le();
13010 __struct.lon = buf.get_i32_le();
13011 __struct.alt = buf.get_i32_le();
13012 __struct.relative_alt = buf.get_i32_le();
13013 __struct.vx = buf.get_i16_le();
13014 __struct.vy = buf.get_i16_le();
13015 __struct.vz = buf.get_i16_le();
13016 __struct.hdg = buf.get_u16_le();
13017 Ok(__struct)
13018 }
13019 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13020 let mut __tmp = BytesMut::new(bytes);
13021 #[allow(clippy::absurd_extreme_comparisons)]
13022 #[allow(unused_comparisons)]
13023 if __tmp.remaining() < Self::ENCODED_LEN {
13024 panic!(
13025 "buffer is too small (need {} bytes, but got {})",
13026 Self::ENCODED_LEN,
13027 __tmp.remaining(),
13028 )
13029 }
13030 __tmp.put_u32_le(self.time_boot_ms);
13031 __tmp.put_i32_le(self.lat);
13032 __tmp.put_i32_le(self.lon);
13033 __tmp.put_i32_le(self.alt);
13034 __tmp.put_i32_le(self.relative_alt);
13035 __tmp.put_i16_le(self.vx);
13036 __tmp.put_i16_le(self.vy);
13037 __tmp.put_i16_le(self.vz);
13038 __tmp.put_u16_le(self.hdg);
13039 if matches!(version, MavlinkVersion::V2) {
13040 let len = __tmp.len();
13041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13042 } else {
13043 __tmp.len()
13044 }
13045 }
13046}
13047#[doc = "id: 63"]
13048#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13049#[derive(Debug, Clone, PartialEq)]
13050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13052pub struct GLOBAL_POSITION_INT_COV_DATA {
13053 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13054 pub time_usec: u64,
13055 #[doc = "Latitude"]
13056 pub lat: i32,
13057 #[doc = "Longitude"]
13058 pub lon: i32,
13059 #[doc = "Altitude in meters above MSL"]
13060 pub alt: i32,
13061 #[doc = "Altitude above ground"]
13062 pub relative_alt: i32,
13063 #[doc = "Ground X Speed (Latitude)"]
13064 pub vx: f32,
13065 #[doc = "Ground Y Speed (Longitude)"]
13066 pub vy: f32,
13067 #[doc = "Ground Z Speed (Altitude)"]
13068 pub vz: f32,
13069 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13070 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13071 pub covariance: [f32; 36],
13072 #[doc = "Class id of the estimator this estimate originated from."]
13073 pub estimator_type: MavEstimatorType,
13074}
13075impl GLOBAL_POSITION_INT_COV_DATA {
13076 pub const ENCODED_LEN: usize = 181usize;
13077 pub const DEFAULT: Self = Self {
13078 time_usec: 0_u64,
13079 lat: 0_i32,
13080 lon: 0_i32,
13081 alt: 0_i32,
13082 relative_alt: 0_i32,
13083 vx: 0.0_f32,
13084 vy: 0.0_f32,
13085 vz: 0.0_f32,
13086 covariance: [0.0_f32; 36usize],
13087 estimator_type: MavEstimatorType::DEFAULT,
13088 };
13089 #[cfg(feature = "arbitrary")]
13090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13091 use arbitrary::{Arbitrary, Unstructured};
13092 let mut buf = [0u8; 1024];
13093 rng.fill_bytes(&mut buf);
13094 let mut unstructured = Unstructured::new(&buf);
13095 Self::arbitrary(&mut unstructured).unwrap_or_default()
13096 }
13097}
13098impl Default for GLOBAL_POSITION_INT_COV_DATA {
13099 fn default() -> Self {
13100 Self::DEFAULT.clone()
13101 }
13102}
13103impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13104 type Message = MavMessage;
13105 const ID: u32 = 63u32;
13106 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13107 const EXTRA_CRC: u8 = 119u8;
13108 const ENCODED_LEN: usize = 181usize;
13109 fn deser(
13110 _version: MavlinkVersion,
13111 __input: &[u8],
13112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13113 let avail_len = __input.len();
13114 let mut payload_buf = [0; Self::ENCODED_LEN];
13115 let mut buf = if avail_len < Self::ENCODED_LEN {
13116 payload_buf[0..avail_len].copy_from_slice(__input);
13117 Bytes::new(&payload_buf)
13118 } else {
13119 Bytes::new(__input)
13120 };
13121 let mut __struct = Self::default();
13122 __struct.time_usec = buf.get_u64_le();
13123 __struct.lat = buf.get_i32_le();
13124 __struct.lon = buf.get_i32_le();
13125 __struct.alt = buf.get_i32_le();
13126 __struct.relative_alt = buf.get_i32_le();
13127 __struct.vx = buf.get_f32_le();
13128 __struct.vy = buf.get_f32_le();
13129 __struct.vz = buf.get_f32_le();
13130 for v in &mut __struct.covariance {
13131 let val = buf.get_f32_le();
13132 *v = val;
13133 }
13134 let tmp = buf.get_u8();
13135 __struct.estimator_type =
13136 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13137 enum_type: "MavEstimatorType",
13138 value: tmp as u32,
13139 })?;
13140 Ok(__struct)
13141 }
13142 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13143 let mut __tmp = BytesMut::new(bytes);
13144 #[allow(clippy::absurd_extreme_comparisons)]
13145 #[allow(unused_comparisons)]
13146 if __tmp.remaining() < Self::ENCODED_LEN {
13147 panic!(
13148 "buffer is too small (need {} bytes, but got {})",
13149 Self::ENCODED_LEN,
13150 __tmp.remaining(),
13151 )
13152 }
13153 __tmp.put_u64_le(self.time_usec);
13154 __tmp.put_i32_le(self.lat);
13155 __tmp.put_i32_le(self.lon);
13156 __tmp.put_i32_le(self.alt);
13157 __tmp.put_i32_le(self.relative_alt);
13158 __tmp.put_f32_le(self.vx);
13159 __tmp.put_f32_le(self.vy);
13160 __tmp.put_f32_le(self.vz);
13161 for val in &self.covariance {
13162 __tmp.put_f32_le(*val);
13163 }
13164 __tmp.put_u8(self.estimator_type as u8);
13165 if matches!(version, MavlinkVersion::V2) {
13166 let len = __tmp.len();
13167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13168 } else {
13169 __tmp.len()
13170 }
13171 }
13172}
13173#[doc = "id: 101"]
13174#[doc = "Global position/attitude estimate from a vision source."]
13175#[derive(Debug, Clone, PartialEq)]
13176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13178pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13179 #[doc = "Timestamp (UNIX time or since system boot)"]
13180 pub usec: u64,
13181 #[doc = "Global X position"]
13182 pub x: f32,
13183 #[doc = "Global Y position"]
13184 pub y: f32,
13185 #[doc = "Global Z position"]
13186 pub z: f32,
13187 #[doc = "Roll angle"]
13188 pub roll: f32,
13189 #[doc = "Pitch angle"]
13190 pub pitch: f32,
13191 #[doc = "Yaw angle"]
13192 pub yaw: f32,
13193 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13194 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13195 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13196 pub covariance: [f32; 21],
13197 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13198 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13199 pub reset_counter: u8,
13200}
13201impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13202 pub const ENCODED_LEN: usize = 117usize;
13203 pub const DEFAULT: Self = Self {
13204 usec: 0_u64,
13205 x: 0.0_f32,
13206 y: 0.0_f32,
13207 z: 0.0_f32,
13208 roll: 0.0_f32,
13209 pitch: 0.0_f32,
13210 yaw: 0.0_f32,
13211 covariance: [0.0_f32; 21usize],
13212 reset_counter: 0_u8,
13213 };
13214 #[cfg(feature = "arbitrary")]
13215 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13216 use arbitrary::{Arbitrary, Unstructured};
13217 let mut buf = [0u8; 1024];
13218 rng.fill_bytes(&mut buf);
13219 let mut unstructured = Unstructured::new(&buf);
13220 Self::arbitrary(&mut unstructured).unwrap_or_default()
13221 }
13222}
13223impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13224 fn default() -> Self {
13225 Self::DEFAULT.clone()
13226 }
13227}
13228impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13229 type Message = MavMessage;
13230 const ID: u32 = 101u32;
13231 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13232 const EXTRA_CRC: u8 = 102u8;
13233 const ENCODED_LEN: usize = 117usize;
13234 fn deser(
13235 _version: MavlinkVersion,
13236 __input: &[u8],
13237 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13238 let avail_len = __input.len();
13239 let mut payload_buf = [0; Self::ENCODED_LEN];
13240 let mut buf = if avail_len < Self::ENCODED_LEN {
13241 payload_buf[0..avail_len].copy_from_slice(__input);
13242 Bytes::new(&payload_buf)
13243 } else {
13244 Bytes::new(__input)
13245 };
13246 let mut __struct = Self::default();
13247 __struct.usec = buf.get_u64_le();
13248 __struct.x = buf.get_f32_le();
13249 __struct.y = buf.get_f32_le();
13250 __struct.z = buf.get_f32_le();
13251 __struct.roll = buf.get_f32_le();
13252 __struct.pitch = buf.get_f32_le();
13253 __struct.yaw = buf.get_f32_le();
13254 for v in &mut __struct.covariance {
13255 let val = buf.get_f32_le();
13256 *v = val;
13257 }
13258 __struct.reset_counter = buf.get_u8();
13259 Ok(__struct)
13260 }
13261 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13262 let mut __tmp = BytesMut::new(bytes);
13263 #[allow(clippy::absurd_extreme_comparisons)]
13264 #[allow(unused_comparisons)]
13265 if __tmp.remaining() < Self::ENCODED_LEN {
13266 panic!(
13267 "buffer is too small (need {} bytes, but got {})",
13268 Self::ENCODED_LEN,
13269 __tmp.remaining(),
13270 )
13271 }
13272 __tmp.put_u64_le(self.usec);
13273 __tmp.put_f32_le(self.x);
13274 __tmp.put_f32_le(self.y);
13275 __tmp.put_f32_le(self.z);
13276 __tmp.put_f32_le(self.roll);
13277 __tmp.put_f32_le(self.pitch);
13278 __tmp.put_f32_le(self.yaw);
13279 for val in &self.covariance {
13280 __tmp.put_f32_le(*val);
13281 }
13282 __tmp.put_u8(self.reset_counter);
13283 if matches!(version, MavlinkVersion::V2) {
13284 let len = __tmp.len();
13285 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13286 } else {
13287 __tmp.len()
13288 }
13289 }
13290}
13291#[doc = "id: 124"]
13292#[doc = "Second GPS data."]
13293#[derive(Debug, Clone, PartialEq)]
13294#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13296pub struct GPS2_RAW_DATA {
13297 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13298 pub time_usec: u64,
13299 #[doc = "Latitude (WGS84)"]
13300 pub lat: i32,
13301 #[doc = "Longitude (WGS84)"]
13302 pub lon: i32,
13303 #[doc = "Altitude (MSL). Positive for up."]
13304 pub alt: i32,
13305 #[doc = "Age of DGPS info"]
13306 pub dgps_age: u32,
13307 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13308 pub eph: u16,
13309 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13310 pub epv: u16,
13311 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13312 pub vel: u16,
13313 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13314 pub cog: u16,
13315 #[doc = "GPS fix type."]
13316 pub fix_type: GpsFixType,
13317 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13318 pub satellites_visible: u8,
13319 #[doc = "Number of DGPS satellites"]
13320 pub dgps_numch: u8,
13321 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13322 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13323 pub yaw: u16,
13324 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13326 pub alt_ellipsoid: i32,
13327 #[doc = "Position uncertainty."]
13328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13329 pub h_acc: u32,
13330 #[doc = "Altitude uncertainty."]
13331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13332 pub v_acc: u32,
13333 #[doc = "Speed uncertainty."]
13334 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13335 pub vel_acc: u32,
13336 #[doc = "Heading / track uncertainty"]
13337 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13338 pub hdg_acc: u32,
13339}
13340impl GPS2_RAW_DATA {
13341 pub const ENCODED_LEN: usize = 57usize;
13342 pub const DEFAULT: Self = Self {
13343 time_usec: 0_u64,
13344 lat: 0_i32,
13345 lon: 0_i32,
13346 alt: 0_i32,
13347 dgps_age: 0_u32,
13348 eph: 0_u16,
13349 epv: 0_u16,
13350 vel: 0_u16,
13351 cog: 0_u16,
13352 fix_type: GpsFixType::DEFAULT,
13353 satellites_visible: 0_u8,
13354 dgps_numch: 0_u8,
13355 yaw: 0_u16,
13356 alt_ellipsoid: 0_i32,
13357 h_acc: 0_u32,
13358 v_acc: 0_u32,
13359 vel_acc: 0_u32,
13360 hdg_acc: 0_u32,
13361 };
13362 #[cfg(feature = "arbitrary")]
13363 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13364 use arbitrary::{Arbitrary, Unstructured};
13365 let mut buf = [0u8; 1024];
13366 rng.fill_bytes(&mut buf);
13367 let mut unstructured = Unstructured::new(&buf);
13368 Self::arbitrary(&mut unstructured).unwrap_or_default()
13369 }
13370}
13371impl Default for GPS2_RAW_DATA {
13372 fn default() -> Self {
13373 Self::DEFAULT.clone()
13374 }
13375}
13376impl MessageData for GPS2_RAW_DATA {
13377 type Message = MavMessage;
13378 const ID: u32 = 124u32;
13379 const NAME: &'static str = "GPS2_RAW";
13380 const EXTRA_CRC: u8 = 87u8;
13381 const ENCODED_LEN: usize = 57usize;
13382 fn deser(
13383 _version: MavlinkVersion,
13384 __input: &[u8],
13385 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13386 let avail_len = __input.len();
13387 let mut payload_buf = [0; Self::ENCODED_LEN];
13388 let mut buf = if avail_len < Self::ENCODED_LEN {
13389 payload_buf[0..avail_len].copy_from_slice(__input);
13390 Bytes::new(&payload_buf)
13391 } else {
13392 Bytes::new(__input)
13393 };
13394 let mut __struct = Self::default();
13395 __struct.time_usec = buf.get_u64_le();
13396 __struct.lat = buf.get_i32_le();
13397 __struct.lon = buf.get_i32_le();
13398 __struct.alt = buf.get_i32_le();
13399 __struct.dgps_age = buf.get_u32_le();
13400 __struct.eph = buf.get_u16_le();
13401 __struct.epv = buf.get_u16_le();
13402 __struct.vel = buf.get_u16_le();
13403 __struct.cog = buf.get_u16_le();
13404 let tmp = buf.get_u8();
13405 __struct.fix_type =
13406 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13407 enum_type: "GpsFixType",
13408 value: tmp as u32,
13409 })?;
13410 __struct.satellites_visible = buf.get_u8();
13411 __struct.dgps_numch = buf.get_u8();
13412 __struct.yaw = buf.get_u16_le();
13413 __struct.alt_ellipsoid = buf.get_i32_le();
13414 __struct.h_acc = buf.get_u32_le();
13415 __struct.v_acc = buf.get_u32_le();
13416 __struct.vel_acc = buf.get_u32_le();
13417 __struct.hdg_acc = buf.get_u32_le();
13418 Ok(__struct)
13419 }
13420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13421 let mut __tmp = BytesMut::new(bytes);
13422 #[allow(clippy::absurd_extreme_comparisons)]
13423 #[allow(unused_comparisons)]
13424 if __tmp.remaining() < Self::ENCODED_LEN {
13425 panic!(
13426 "buffer is too small (need {} bytes, but got {})",
13427 Self::ENCODED_LEN,
13428 __tmp.remaining(),
13429 )
13430 }
13431 __tmp.put_u64_le(self.time_usec);
13432 __tmp.put_i32_le(self.lat);
13433 __tmp.put_i32_le(self.lon);
13434 __tmp.put_i32_le(self.alt);
13435 __tmp.put_u32_le(self.dgps_age);
13436 __tmp.put_u16_le(self.eph);
13437 __tmp.put_u16_le(self.epv);
13438 __tmp.put_u16_le(self.vel);
13439 __tmp.put_u16_le(self.cog);
13440 __tmp.put_u8(self.fix_type as u8);
13441 __tmp.put_u8(self.satellites_visible);
13442 __tmp.put_u8(self.dgps_numch);
13443 __tmp.put_u16_le(self.yaw);
13444 __tmp.put_i32_le(self.alt_ellipsoid);
13445 __tmp.put_u32_le(self.h_acc);
13446 __tmp.put_u32_le(self.v_acc);
13447 __tmp.put_u32_le(self.vel_acc);
13448 __tmp.put_u32_le(self.hdg_acc);
13449 if matches!(version, MavlinkVersion::V2) {
13450 let len = __tmp.len();
13451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13452 } else {
13453 __tmp.len()
13454 }
13455 }
13456}
13457#[doc = "id: 128"]
13458#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13459#[derive(Debug, Clone, PartialEq)]
13460#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13461#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13462pub struct GPS2_RTK_DATA {
13463 #[doc = "Time since boot of last baseline message received."]
13464 pub time_last_baseline_ms: u32,
13465 #[doc = "GPS Time of Week of last baseline"]
13466 pub tow: u32,
13467 #[doc = "Current baseline in ECEF x or NED north component."]
13468 pub baseline_a_mm: i32,
13469 #[doc = "Current baseline in ECEF y or NED east component."]
13470 pub baseline_b_mm: i32,
13471 #[doc = "Current baseline in ECEF z or NED down component."]
13472 pub baseline_c_mm: i32,
13473 #[doc = "Current estimate of baseline accuracy."]
13474 pub accuracy: u32,
13475 #[doc = "Current number of integer ambiguity hypotheses."]
13476 pub iar_num_hypotheses: i32,
13477 #[doc = "GPS Week Number of last baseline"]
13478 pub wn: u16,
13479 #[doc = "Identification of connected RTK receiver."]
13480 pub rtk_receiver_id: u8,
13481 #[doc = "GPS-specific health report for RTK data."]
13482 pub rtk_health: u8,
13483 #[doc = "Rate of baseline messages being received by GPS"]
13484 pub rtk_rate: u8,
13485 #[doc = "Current number of sats used for RTK calculation."]
13486 pub nsats: u8,
13487 #[doc = "Coordinate system of baseline"]
13488 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13489}
13490impl GPS2_RTK_DATA {
13491 pub const ENCODED_LEN: usize = 35usize;
13492 pub const DEFAULT: Self = Self {
13493 time_last_baseline_ms: 0_u32,
13494 tow: 0_u32,
13495 baseline_a_mm: 0_i32,
13496 baseline_b_mm: 0_i32,
13497 baseline_c_mm: 0_i32,
13498 accuracy: 0_u32,
13499 iar_num_hypotheses: 0_i32,
13500 wn: 0_u16,
13501 rtk_receiver_id: 0_u8,
13502 rtk_health: 0_u8,
13503 rtk_rate: 0_u8,
13504 nsats: 0_u8,
13505 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13506 };
13507 #[cfg(feature = "arbitrary")]
13508 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13509 use arbitrary::{Arbitrary, Unstructured};
13510 let mut buf = [0u8; 1024];
13511 rng.fill_bytes(&mut buf);
13512 let mut unstructured = Unstructured::new(&buf);
13513 Self::arbitrary(&mut unstructured).unwrap_or_default()
13514 }
13515}
13516impl Default for GPS2_RTK_DATA {
13517 fn default() -> Self {
13518 Self::DEFAULT.clone()
13519 }
13520}
13521impl MessageData for GPS2_RTK_DATA {
13522 type Message = MavMessage;
13523 const ID: u32 = 128u32;
13524 const NAME: &'static str = "GPS2_RTK";
13525 const EXTRA_CRC: u8 = 226u8;
13526 const ENCODED_LEN: usize = 35usize;
13527 fn deser(
13528 _version: MavlinkVersion,
13529 __input: &[u8],
13530 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13531 let avail_len = __input.len();
13532 let mut payload_buf = [0; Self::ENCODED_LEN];
13533 let mut buf = if avail_len < Self::ENCODED_LEN {
13534 payload_buf[0..avail_len].copy_from_slice(__input);
13535 Bytes::new(&payload_buf)
13536 } else {
13537 Bytes::new(__input)
13538 };
13539 let mut __struct = Self::default();
13540 __struct.time_last_baseline_ms = buf.get_u32_le();
13541 __struct.tow = buf.get_u32_le();
13542 __struct.baseline_a_mm = buf.get_i32_le();
13543 __struct.baseline_b_mm = buf.get_i32_le();
13544 __struct.baseline_c_mm = buf.get_i32_le();
13545 __struct.accuracy = buf.get_u32_le();
13546 __struct.iar_num_hypotheses = buf.get_i32_le();
13547 __struct.wn = buf.get_u16_le();
13548 __struct.rtk_receiver_id = buf.get_u8();
13549 __struct.rtk_health = buf.get_u8();
13550 __struct.rtk_rate = buf.get_u8();
13551 __struct.nsats = buf.get_u8();
13552 let tmp = buf.get_u8();
13553 __struct.baseline_coords_type =
13554 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13555 enum_type: "RtkBaselineCoordinateSystem",
13556 value: tmp as u32,
13557 })?;
13558 Ok(__struct)
13559 }
13560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13561 let mut __tmp = BytesMut::new(bytes);
13562 #[allow(clippy::absurd_extreme_comparisons)]
13563 #[allow(unused_comparisons)]
13564 if __tmp.remaining() < Self::ENCODED_LEN {
13565 panic!(
13566 "buffer is too small (need {} bytes, but got {})",
13567 Self::ENCODED_LEN,
13568 __tmp.remaining(),
13569 )
13570 }
13571 __tmp.put_u32_le(self.time_last_baseline_ms);
13572 __tmp.put_u32_le(self.tow);
13573 __tmp.put_i32_le(self.baseline_a_mm);
13574 __tmp.put_i32_le(self.baseline_b_mm);
13575 __tmp.put_i32_le(self.baseline_c_mm);
13576 __tmp.put_u32_le(self.accuracy);
13577 __tmp.put_i32_le(self.iar_num_hypotheses);
13578 __tmp.put_u16_le(self.wn);
13579 __tmp.put_u8(self.rtk_receiver_id);
13580 __tmp.put_u8(self.rtk_health);
13581 __tmp.put_u8(self.rtk_rate);
13582 __tmp.put_u8(self.nsats);
13583 __tmp.put_u8(self.baseline_coords_type as u8);
13584 if matches!(version, MavlinkVersion::V2) {
13585 let len = __tmp.len();
13586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13587 } else {
13588 __tmp.len()
13589 }
13590 }
13591}
13592#[doc = "id: 49"]
13593#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13594#[derive(Debug, Clone, PartialEq)]
13595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13597pub struct GPS_GLOBAL_ORIGIN_DATA {
13598 #[doc = "Latitude (WGS84)"]
13599 pub latitude: i32,
13600 #[doc = "Longitude (WGS84)"]
13601 pub longitude: i32,
13602 #[doc = "Altitude (MSL). Positive for up."]
13603 pub altitude: i32,
13604 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13605 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13606 pub time_usec: u64,
13607}
13608impl GPS_GLOBAL_ORIGIN_DATA {
13609 pub const ENCODED_LEN: usize = 20usize;
13610 pub const DEFAULT: Self = Self {
13611 latitude: 0_i32,
13612 longitude: 0_i32,
13613 altitude: 0_i32,
13614 time_usec: 0_u64,
13615 };
13616 #[cfg(feature = "arbitrary")]
13617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13618 use arbitrary::{Arbitrary, Unstructured};
13619 let mut buf = [0u8; 1024];
13620 rng.fill_bytes(&mut buf);
13621 let mut unstructured = Unstructured::new(&buf);
13622 Self::arbitrary(&mut unstructured).unwrap_or_default()
13623 }
13624}
13625impl Default for GPS_GLOBAL_ORIGIN_DATA {
13626 fn default() -> Self {
13627 Self::DEFAULT.clone()
13628 }
13629}
13630impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13631 type Message = MavMessage;
13632 const ID: u32 = 49u32;
13633 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13634 const EXTRA_CRC: u8 = 39u8;
13635 const ENCODED_LEN: usize = 20usize;
13636 fn deser(
13637 _version: MavlinkVersion,
13638 __input: &[u8],
13639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13640 let avail_len = __input.len();
13641 let mut payload_buf = [0; Self::ENCODED_LEN];
13642 let mut buf = if avail_len < Self::ENCODED_LEN {
13643 payload_buf[0..avail_len].copy_from_slice(__input);
13644 Bytes::new(&payload_buf)
13645 } else {
13646 Bytes::new(__input)
13647 };
13648 let mut __struct = Self::default();
13649 __struct.latitude = buf.get_i32_le();
13650 __struct.longitude = buf.get_i32_le();
13651 __struct.altitude = buf.get_i32_le();
13652 __struct.time_usec = buf.get_u64_le();
13653 Ok(__struct)
13654 }
13655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13656 let mut __tmp = BytesMut::new(bytes);
13657 #[allow(clippy::absurd_extreme_comparisons)]
13658 #[allow(unused_comparisons)]
13659 if __tmp.remaining() < Self::ENCODED_LEN {
13660 panic!(
13661 "buffer is too small (need {} bytes, but got {})",
13662 Self::ENCODED_LEN,
13663 __tmp.remaining(),
13664 )
13665 }
13666 __tmp.put_i32_le(self.latitude);
13667 __tmp.put_i32_le(self.longitude);
13668 __tmp.put_i32_le(self.altitude);
13669 __tmp.put_u64_le(self.time_usec);
13670 if matches!(version, MavlinkVersion::V2) {
13671 let len = __tmp.len();
13672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13673 } else {
13674 __tmp.len()
13675 }
13676 }
13677}
13678#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
13679#[doc = "id: 123"]
13680#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
13681#[derive(Debug, Clone, PartialEq)]
13682#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13683#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13684pub struct GPS_INJECT_DATA_DATA {
13685 #[doc = "System ID"]
13686 pub target_system: u8,
13687 #[doc = "Component ID"]
13688 pub target_component: u8,
13689 #[doc = "Data length"]
13690 pub len: u8,
13691 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
13692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13693 pub data: [u8; 110],
13694}
13695impl GPS_INJECT_DATA_DATA {
13696 pub const ENCODED_LEN: usize = 113usize;
13697 pub const DEFAULT: Self = Self {
13698 target_system: 0_u8,
13699 target_component: 0_u8,
13700 len: 0_u8,
13701 data: [0_u8; 110usize],
13702 };
13703 #[cfg(feature = "arbitrary")]
13704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13705 use arbitrary::{Arbitrary, Unstructured};
13706 let mut buf = [0u8; 1024];
13707 rng.fill_bytes(&mut buf);
13708 let mut unstructured = Unstructured::new(&buf);
13709 Self::arbitrary(&mut unstructured).unwrap_or_default()
13710 }
13711}
13712impl Default for GPS_INJECT_DATA_DATA {
13713 fn default() -> Self {
13714 Self::DEFAULT.clone()
13715 }
13716}
13717impl MessageData for GPS_INJECT_DATA_DATA {
13718 type Message = MavMessage;
13719 const ID: u32 = 123u32;
13720 const NAME: &'static str = "GPS_INJECT_DATA";
13721 const EXTRA_CRC: u8 = 250u8;
13722 const ENCODED_LEN: usize = 113usize;
13723 fn deser(
13724 _version: MavlinkVersion,
13725 __input: &[u8],
13726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13727 let avail_len = __input.len();
13728 let mut payload_buf = [0; Self::ENCODED_LEN];
13729 let mut buf = if avail_len < Self::ENCODED_LEN {
13730 payload_buf[0..avail_len].copy_from_slice(__input);
13731 Bytes::new(&payload_buf)
13732 } else {
13733 Bytes::new(__input)
13734 };
13735 let mut __struct = Self::default();
13736 __struct.target_system = buf.get_u8();
13737 __struct.target_component = buf.get_u8();
13738 __struct.len = buf.get_u8();
13739 for v in &mut __struct.data {
13740 let val = buf.get_u8();
13741 *v = val;
13742 }
13743 Ok(__struct)
13744 }
13745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13746 let mut __tmp = BytesMut::new(bytes);
13747 #[allow(clippy::absurd_extreme_comparisons)]
13748 #[allow(unused_comparisons)]
13749 if __tmp.remaining() < Self::ENCODED_LEN {
13750 panic!(
13751 "buffer is too small (need {} bytes, but got {})",
13752 Self::ENCODED_LEN,
13753 __tmp.remaining(),
13754 )
13755 }
13756 __tmp.put_u8(self.target_system);
13757 __tmp.put_u8(self.target_component);
13758 __tmp.put_u8(self.len);
13759 for val in &self.data {
13760 __tmp.put_u8(*val);
13761 }
13762 if matches!(version, MavlinkVersion::V2) {
13763 let len = __tmp.len();
13764 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13765 } else {
13766 __tmp.len()
13767 }
13768 }
13769}
13770#[doc = "id: 232"]
13771#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
13772#[derive(Debug, Clone, PartialEq)]
13773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13775pub struct GPS_INPUT_DATA {
13776 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13777 pub time_usec: u64,
13778 #[doc = "GPS time (from start of GPS week)"]
13779 pub time_week_ms: u32,
13780 #[doc = "Latitude (WGS84)"]
13781 pub lat: i32,
13782 #[doc = "Longitude (WGS84)"]
13783 pub lon: i32,
13784 #[doc = "Altitude (MSL). Positive for up."]
13785 pub alt: f32,
13786 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13787 pub hdop: f32,
13788 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
13789 pub vdop: f32,
13790 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
13791 pub vn: f32,
13792 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
13793 pub ve: f32,
13794 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
13795 pub vd: f32,
13796 #[doc = "GPS speed accuracy"]
13797 pub speed_accuracy: f32,
13798 #[doc = "GPS horizontal accuracy"]
13799 pub horiz_accuracy: f32,
13800 #[doc = "GPS vertical accuracy"]
13801 pub vert_accuracy: f32,
13802 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
13803 pub ignore_flags: GpsInputIgnoreFlags,
13804 #[doc = "GPS week number"]
13805 pub time_week: u16,
13806 #[doc = "ID of the GPS for multiple GPS inputs"]
13807 pub gps_id: u8,
13808 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
13809 pub fix_type: u8,
13810 #[doc = "Number of satellites visible."]
13811 pub satellites_visible: u8,
13812 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
13813 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13814 pub yaw: u16,
13815}
13816impl GPS_INPUT_DATA {
13817 pub const ENCODED_LEN: usize = 65usize;
13818 pub const DEFAULT: Self = Self {
13819 time_usec: 0_u64,
13820 time_week_ms: 0_u32,
13821 lat: 0_i32,
13822 lon: 0_i32,
13823 alt: 0.0_f32,
13824 hdop: 0.0_f32,
13825 vdop: 0.0_f32,
13826 vn: 0.0_f32,
13827 ve: 0.0_f32,
13828 vd: 0.0_f32,
13829 speed_accuracy: 0.0_f32,
13830 horiz_accuracy: 0.0_f32,
13831 vert_accuracy: 0.0_f32,
13832 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
13833 time_week: 0_u16,
13834 gps_id: 0_u8,
13835 fix_type: 0_u8,
13836 satellites_visible: 0_u8,
13837 yaw: 0_u16,
13838 };
13839 #[cfg(feature = "arbitrary")]
13840 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13841 use arbitrary::{Arbitrary, Unstructured};
13842 let mut buf = [0u8; 1024];
13843 rng.fill_bytes(&mut buf);
13844 let mut unstructured = Unstructured::new(&buf);
13845 Self::arbitrary(&mut unstructured).unwrap_or_default()
13846 }
13847}
13848impl Default for GPS_INPUT_DATA {
13849 fn default() -> Self {
13850 Self::DEFAULT.clone()
13851 }
13852}
13853impl MessageData for GPS_INPUT_DATA {
13854 type Message = MavMessage;
13855 const ID: u32 = 232u32;
13856 const NAME: &'static str = "GPS_INPUT";
13857 const EXTRA_CRC: u8 = 151u8;
13858 const ENCODED_LEN: usize = 65usize;
13859 fn deser(
13860 _version: MavlinkVersion,
13861 __input: &[u8],
13862 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13863 let avail_len = __input.len();
13864 let mut payload_buf = [0; Self::ENCODED_LEN];
13865 let mut buf = if avail_len < Self::ENCODED_LEN {
13866 payload_buf[0..avail_len].copy_from_slice(__input);
13867 Bytes::new(&payload_buf)
13868 } else {
13869 Bytes::new(__input)
13870 };
13871 let mut __struct = Self::default();
13872 __struct.time_usec = buf.get_u64_le();
13873 __struct.time_week_ms = buf.get_u32_le();
13874 __struct.lat = buf.get_i32_le();
13875 __struct.lon = buf.get_i32_le();
13876 __struct.alt = buf.get_f32_le();
13877 __struct.hdop = buf.get_f32_le();
13878 __struct.vdop = buf.get_f32_le();
13879 __struct.vn = buf.get_f32_le();
13880 __struct.ve = buf.get_f32_le();
13881 __struct.vd = buf.get_f32_le();
13882 __struct.speed_accuracy = buf.get_f32_le();
13883 __struct.horiz_accuracy = buf.get_f32_le();
13884 __struct.vert_accuracy = buf.get_f32_le();
13885 let tmp = buf.get_u16_le();
13886 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
13887 tmp & GpsInputIgnoreFlags::all().bits(),
13888 )
13889 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13890 flag_type: "GpsInputIgnoreFlags",
13891 value: tmp as u32,
13892 })?;
13893 __struct.time_week = buf.get_u16_le();
13894 __struct.gps_id = buf.get_u8();
13895 __struct.fix_type = buf.get_u8();
13896 __struct.satellites_visible = buf.get_u8();
13897 __struct.yaw = buf.get_u16_le();
13898 Ok(__struct)
13899 }
13900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13901 let mut __tmp = BytesMut::new(bytes);
13902 #[allow(clippy::absurd_extreme_comparisons)]
13903 #[allow(unused_comparisons)]
13904 if __tmp.remaining() < Self::ENCODED_LEN {
13905 panic!(
13906 "buffer is too small (need {} bytes, but got {})",
13907 Self::ENCODED_LEN,
13908 __tmp.remaining(),
13909 )
13910 }
13911 __tmp.put_u64_le(self.time_usec);
13912 __tmp.put_u32_le(self.time_week_ms);
13913 __tmp.put_i32_le(self.lat);
13914 __tmp.put_i32_le(self.lon);
13915 __tmp.put_f32_le(self.alt);
13916 __tmp.put_f32_le(self.hdop);
13917 __tmp.put_f32_le(self.vdop);
13918 __tmp.put_f32_le(self.vn);
13919 __tmp.put_f32_le(self.ve);
13920 __tmp.put_f32_le(self.vd);
13921 __tmp.put_f32_le(self.speed_accuracy);
13922 __tmp.put_f32_le(self.horiz_accuracy);
13923 __tmp.put_f32_le(self.vert_accuracy);
13924 __tmp.put_u16_le(self.ignore_flags.bits());
13925 __tmp.put_u16_le(self.time_week);
13926 __tmp.put_u8(self.gps_id);
13927 __tmp.put_u8(self.fix_type);
13928 __tmp.put_u8(self.satellites_visible);
13929 __tmp.put_u16_le(self.yaw);
13930 if matches!(version, MavlinkVersion::V2) {
13931 let len = __tmp.len();
13932 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13933 } else {
13934 __tmp.len()
13935 }
13936 }
13937}
13938#[doc = "id: 24"]
13939#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
13940#[derive(Debug, Clone, PartialEq)]
13941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13943pub struct GPS_RAW_INT_DATA {
13944 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13945 pub time_usec: u64,
13946 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
13947 pub lat: i32,
13948 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
13949 pub lon: i32,
13950 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
13951 pub alt: i32,
13952 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13953 pub eph: u16,
13954 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13955 pub epv: u16,
13956 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13957 pub vel: u16,
13958 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13959 pub cog: u16,
13960 #[doc = "GPS fix type."]
13961 pub fix_type: GpsFixType,
13962 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13963 pub satellites_visible: u8,
13964 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13965 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13966 pub alt_ellipsoid: i32,
13967 #[doc = "Position uncertainty."]
13968 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13969 pub h_acc: u32,
13970 #[doc = "Altitude uncertainty."]
13971 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13972 pub v_acc: u32,
13973 #[doc = "Speed uncertainty."]
13974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13975 pub vel_acc: u32,
13976 #[doc = "Heading / track uncertainty"]
13977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13978 pub hdg_acc: u32,
13979 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13980 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13981 pub yaw: u16,
13982}
13983impl GPS_RAW_INT_DATA {
13984 pub const ENCODED_LEN: usize = 52usize;
13985 pub const DEFAULT: Self = Self {
13986 time_usec: 0_u64,
13987 lat: 0_i32,
13988 lon: 0_i32,
13989 alt: 0_i32,
13990 eph: 0_u16,
13991 epv: 0_u16,
13992 vel: 0_u16,
13993 cog: 0_u16,
13994 fix_type: GpsFixType::DEFAULT,
13995 satellites_visible: 0_u8,
13996 alt_ellipsoid: 0_i32,
13997 h_acc: 0_u32,
13998 v_acc: 0_u32,
13999 vel_acc: 0_u32,
14000 hdg_acc: 0_u32,
14001 yaw: 0_u16,
14002 };
14003 #[cfg(feature = "arbitrary")]
14004 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14005 use arbitrary::{Arbitrary, Unstructured};
14006 let mut buf = [0u8; 1024];
14007 rng.fill_bytes(&mut buf);
14008 let mut unstructured = Unstructured::new(&buf);
14009 Self::arbitrary(&mut unstructured).unwrap_or_default()
14010 }
14011}
14012impl Default for GPS_RAW_INT_DATA {
14013 fn default() -> Self {
14014 Self::DEFAULT.clone()
14015 }
14016}
14017impl MessageData for GPS_RAW_INT_DATA {
14018 type Message = MavMessage;
14019 const ID: u32 = 24u32;
14020 const NAME: &'static str = "GPS_RAW_INT";
14021 const EXTRA_CRC: u8 = 24u8;
14022 const ENCODED_LEN: usize = 52usize;
14023 fn deser(
14024 _version: MavlinkVersion,
14025 __input: &[u8],
14026 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14027 let avail_len = __input.len();
14028 let mut payload_buf = [0; Self::ENCODED_LEN];
14029 let mut buf = if avail_len < Self::ENCODED_LEN {
14030 payload_buf[0..avail_len].copy_from_slice(__input);
14031 Bytes::new(&payload_buf)
14032 } else {
14033 Bytes::new(__input)
14034 };
14035 let mut __struct = Self::default();
14036 __struct.time_usec = buf.get_u64_le();
14037 __struct.lat = buf.get_i32_le();
14038 __struct.lon = buf.get_i32_le();
14039 __struct.alt = buf.get_i32_le();
14040 __struct.eph = buf.get_u16_le();
14041 __struct.epv = buf.get_u16_le();
14042 __struct.vel = buf.get_u16_le();
14043 __struct.cog = buf.get_u16_le();
14044 let tmp = buf.get_u8();
14045 __struct.fix_type =
14046 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14047 enum_type: "GpsFixType",
14048 value: tmp as u32,
14049 })?;
14050 __struct.satellites_visible = buf.get_u8();
14051 __struct.alt_ellipsoid = buf.get_i32_le();
14052 __struct.h_acc = buf.get_u32_le();
14053 __struct.v_acc = buf.get_u32_le();
14054 __struct.vel_acc = buf.get_u32_le();
14055 __struct.hdg_acc = buf.get_u32_le();
14056 __struct.yaw = buf.get_u16_le();
14057 Ok(__struct)
14058 }
14059 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14060 let mut __tmp = BytesMut::new(bytes);
14061 #[allow(clippy::absurd_extreme_comparisons)]
14062 #[allow(unused_comparisons)]
14063 if __tmp.remaining() < Self::ENCODED_LEN {
14064 panic!(
14065 "buffer is too small (need {} bytes, but got {})",
14066 Self::ENCODED_LEN,
14067 __tmp.remaining(),
14068 )
14069 }
14070 __tmp.put_u64_le(self.time_usec);
14071 __tmp.put_i32_le(self.lat);
14072 __tmp.put_i32_le(self.lon);
14073 __tmp.put_i32_le(self.alt);
14074 __tmp.put_u16_le(self.eph);
14075 __tmp.put_u16_le(self.epv);
14076 __tmp.put_u16_le(self.vel);
14077 __tmp.put_u16_le(self.cog);
14078 __tmp.put_u8(self.fix_type as u8);
14079 __tmp.put_u8(self.satellites_visible);
14080 __tmp.put_i32_le(self.alt_ellipsoid);
14081 __tmp.put_u32_le(self.h_acc);
14082 __tmp.put_u32_le(self.v_acc);
14083 __tmp.put_u32_le(self.vel_acc);
14084 __tmp.put_u32_le(self.hdg_acc);
14085 __tmp.put_u16_le(self.yaw);
14086 if matches!(version, MavlinkVersion::V2) {
14087 let len = __tmp.len();
14088 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14089 } else {
14090 __tmp.len()
14091 }
14092 }
14093}
14094#[doc = "id: 233"]
14095#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14096#[derive(Debug, Clone, PartialEq)]
14097#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14098#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14099pub struct GPS_RTCM_DATA_DATA {
14100 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14101 pub flags: u8,
14102 #[doc = "data length"]
14103 pub len: u8,
14104 #[doc = "RTCM message (may be fragmented)"]
14105 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14106 pub data: [u8; 180],
14107}
14108impl GPS_RTCM_DATA_DATA {
14109 pub const ENCODED_LEN: usize = 182usize;
14110 pub const DEFAULT: Self = Self {
14111 flags: 0_u8,
14112 len: 0_u8,
14113 data: [0_u8; 180usize],
14114 };
14115 #[cfg(feature = "arbitrary")]
14116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14117 use arbitrary::{Arbitrary, Unstructured};
14118 let mut buf = [0u8; 1024];
14119 rng.fill_bytes(&mut buf);
14120 let mut unstructured = Unstructured::new(&buf);
14121 Self::arbitrary(&mut unstructured).unwrap_or_default()
14122 }
14123}
14124impl Default for GPS_RTCM_DATA_DATA {
14125 fn default() -> Self {
14126 Self::DEFAULT.clone()
14127 }
14128}
14129impl MessageData for GPS_RTCM_DATA_DATA {
14130 type Message = MavMessage;
14131 const ID: u32 = 233u32;
14132 const NAME: &'static str = "GPS_RTCM_DATA";
14133 const EXTRA_CRC: u8 = 35u8;
14134 const ENCODED_LEN: usize = 182usize;
14135 fn deser(
14136 _version: MavlinkVersion,
14137 __input: &[u8],
14138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14139 let avail_len = __input.len();
14140 let mut payload_buf = [0; Self::ENCODED_LEN];
14141 let mut buf = if avail_len < Self::ENCODED_LEN {
14142 payload_buf[0..avail_len].copy_from_slice(__input);
14143 Bytes::new(&payload_buf)
14144 } else {
14145 Bytes::new(__input)
14146 };
14147 let mut __struct = Self::default();
14148 __struct.flags = buf.get_u8();
14149 __struct.len = buf.get_u8();
14150 for v in &mut __struct.data {
14151 let val = buf.get_u8();
14152 *v = val;
14153 }
14154 Ok(__struct)
14155 }
14156 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14157 let mut __tmp = BytesMut::new(bytes);
14158 #[allow(clippy::absurd_extreme_comparisons)]
14159 #[allow(unused_comparisons)]
14160 if __tmp.remaining() < Self::ENCODED_LEN {
14161 panic!(
14162 "buffer is too small (need {} bytes, but got {})",
14163 Self::ENCODED_LEN,
14164 __tmp.remaining(),
14165 )
14166 }
14167 __tmp.put_u8(self.flags);
14168 __tmp.put_u8(self.len);
14169 for val in &self.data {
14170 __tmp.put_u8(*val);
14171 }
14172 if matches!(version, MavlinkVersion::V2) {
14173 let len = __tmp.len();
14174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14175 } else {
14176 __tmp.len()
14177 }
14178 }
14179}
14180#[doc = "id: 127"]
14181#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14182#[derive(Debug, Clone, PartialEq)]
14183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14185pub struct GPS_RTK_DATA {
14186 #[doc = "Time since boot of last baseline message received."]
14187 pub time_last_baseline_ms: u32,
14188 #[doc = "GPS Time of Week of last baseline"]
14189 pub tow: u32,
14190 #[doc = "Current baseline in ECEF x or NED north component."]
14191 pub baseline_a_mm: i32,
14192 #[doc = "Current baseline in ECEF y or NED east component."]
14193 pub baseline_b_mm: i32,
14194 #[doc = "Current baseline in ECEF z or NED down component."]
14195 pub baseline_c_mm: i32,
14196 #[doc = "Current estimate of baseline accuracy."]
14197 pub accuracy: u32,
14198 #[doc = "Current number of integer ambiguity hypotheses."]
14199 pub iar_num_hypotheses: i32,
14200 #[doc = "GPS Week Number of last baseline"]
14201 pub wn: u16,
14202 #[doc = "Identification of connected RTK receiver."]
14203 pub rtk_receiver_id: u8,
14204 #[doc = "GPS-specific health report for RTK data."]
14205 pub rtk_health: u8,
14206 #[doc = "Rate of baseline messages being received by GPS"]
14207 pub rtk_rate: u8,
14208 #[doc = "Current number of sats used for RTK calculation."]
14209 pub nsats: u8,
14210 #[doc = "Coordinate system of baseline"]
14211 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14212}
14213impl GPS_RTK_DATA {
14214 pub const ENCODED_LEN: usize = 35usize;
14215 pub const DEFAULT: Self = Self {
14216 time_last_baseline_ms: 0_u32,
14217 tow: 0_u32,
14218 baseline_a_mm: 0_i32,
14219 baseline_b_mm: 0_i32,
14220 baseline_c_mm: 0_i32,
14221 accuracy: 0_u32,
14222 iar_num_hypotheses: 0_i32,
14223 wn: 0_u16,
14224 rtk_receiver_id: 0_u8,
14225 rtk_health: 0_u8,
14226 rtk_rate: 0_u8,
14227 nsats: 0_u8,
14228 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14229 };
14230 #[cfg(feature = "arbitrary")]
14231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14232 use arbitrary::{Arbitrary, Unstructured};
14233 let mut buf = [0u8; 1024];
14234 rng.fill_bytes(&mut buf);
14235 let mut unstructured = Unstructured::new(&buf);
14236 Self::arbitrary(&mut unstructured).unwrap_or_default()
14237 }
14238}
14239impl Default for GPS_RTK_DATA {
14240 fn default() -> Self {
14241 Self::DEFAULT.clone()
14242 }
14243}
14244impl MessageData for GPS_RTK_DATA {
14245 type Message = MavMessage;
14246 const ID: u32 = 127u32;
14247 const NAME: &'static str = "GPS_RTK";
14248 const EXTRA_CRC: u8 = 25u8;
14249 const ENCODED_LEN: usize = 35usize;
14250 fn deser(
14251 _version: MavlinkVersion,
14252 __input: &[u8],
14253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14254 let avail_len = __input.len();
14255 let mut payload_buf = [0; Self::ENCODED_LEN];
14256 let mut buf = if avail_len < Self::ENCODED_LEN {
14257 payload_buf[0..avail_len].copy_from_slice(__input);
14258 Bytes::new(&payload_buf)
14259 } else {
14260 Bytes::new(__input)
14261 };
14262 let mut __struct = Self::default();
14263 __struct.time_last_baseline_ms = buf.get_u32_le();
14264 __struct.tow = buf.get_u32_le();
14265 __struct.baseline_a_mm = buf.get_i32_le();
14266 __struct.baseline_b_mm = buf.get_i32_le();
14267 __struct.baseline_c_mm = buf.get_i32_le();
14268 __struct.accuracy = buf.get_u32_le();
14269 __struct.iar_num_hypotheses = buf.get_i32_le();
14270 __struct.wn = buf.get_u16_le();
14271 __struct.rtk_receiver_id = buf.get_u8();
14272 __struct.rtk_health = buf.get_u8();
14273 __struct.rtk_rate = buf.get_u8();
14274 __struct.nsats = buf.get_u8();
14275 let tmp = buf.get_u8();
14276 __struct.baseline_coords_type =
14277 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14278 enum_type: "RtkBaselineCoordinateSystem",
14279 value: tmp as u32,
14280 })?;
14281 Ok(__struct)
14282 }
14283 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14284 let mut __tmp = BytesMut::new(bytes);
14285 #[allow(clippy::absurd_extreme_comparisons)]
14286 #[allow(unused_comparisons)]
14287 if __tmp.remaining() < Self::ENCODED_LEN {
14288 panic!(
14289 "buffer is too small (need {} bytes, but got {})",
14290 Self::ENCODED_LEN,
14291 __tmp.remaining(),
14292 )
14293 }
14294 __tmp.put_u32_le(self.time_last_baseline_ms);
14295 __tmp.put_u32_le(self.tow);
14296 __tmp.put_i32_le(self.baseline_a_mm);
14297 __tmp.put_i32_le(self.baseline_b_mm);
14298 __tmp.put_i32_le(self.baseline_c_mm);
14299 __tmp.put_u32_le(self.accuracy);
14300 __tmp.put_i32_le(self.iar_num_hypotheses);
14301 __tmp.put_u16_le(self.wn);
14302 __tmp.put_u8(self.rtk_receiver_id);
14303 __tmp.put_u8(self.rtk_health);
14304 __tmp.put_u8(self.rtk_rate);
14305 __tmp.put_u8(self.nsats);
14306 __tmp.put_u8(self.baseline_coords_type as u8);
14307 if matches!(version, MavlinkVersion::V2) {
14308 let len = __tmp.len();
14309 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14310 } else {
14311 __tmp.len()
14312 }
14313 }
14314}
14315#[doc = "id: 25"]
14316#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14317#[derive(Debug, Clone, PartialEq)]
14318#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14320pub struct GPS_STATUS_DATA {
14321 #[doc = "Number of satellites visible"]
14322 pub satellites_visible: u8,
14323 #[doc = "Global satellite ID"]
14324 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14325 pub satellite_prn: [u8; 20],
14326 #[doc = "0: Satellite not used, 1: used for localization"]
14327 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14328 pub satellite_used: [u8; 20],
14329 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14331 pub satellite_elevation: [u8; 20],
14332 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14333 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14334 pub satellite_azimuth: [u8; 20],
14335 #[doc = "Signal to noise ratio of satellite"]
14336 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14337 pub satellite_snr: [u8; 20],
14338}
14339impl GPS_STATUS_DATA {
14340 pub const ENCODED_LEN: usize = 101usize;
14341 pub const DEFAULT: Self = Self {
14342 satellites_visible: 0_u8,
14343 satellite_prn: [0_u8; 20usize],
14344 satellite_used: [0_u8; 20usize],
14345 satellite_elevation: [0_u8; 20usize],
14346 satellite_azimuth: [0_u8; 20usize],
14347 satellite_snr: [0_u8; 20usize],
14348 };
14349 #[cfg(feature = "arbitrary")]
14350 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14351 use arbitrary::{Arbitrary, Unstructured};
14352 let mut buf = [0u8; 1024];
14353 rng.fill_bytes(&mut buf);
14354 let mut unstructured = Unstructured::new(&buf);
14355 Self::arbitrary(&mut unstructured).unwrap_or_default()
14356 }
14357}
14358impl Default for GPS_STATUS_DATA {
14359 fn default() -> Self {
14360 Self::DEFAULT.clone()
14361 }
14362}
14363impl MessageData for GPS_STATUS_DATA {
14364 type Message = MavMessage;
14365 const ID: u32 = 25u32;
14366 const NAME: &'static str = "GPS_STATUS";
14367 const EXTRA_CRC: u8 = 23u8;
14368 const ENCODED_LEN: usize = 101usize;
14369 fn deser(
14370 _version: MavlinkVersion,
14371 __input: &[u8],
14372 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14373 let avail_len = __input.len();
14374 let mut payload_buf = [0; Self::ENCODED_LEN];
14375 let mut buf = if avail_len < Self::ENCODED_LEN {
14376 payload_buf[0..avail_len].copy_from_slice(__input);
14377 Bytes::new(&payload_buf)
14378 } else {
14379 Bytes::new(__input)
14380 };
14381 let mut __struct = Self::default();
14382 __struct.satellites_visible = buf.get_u8();
14383 for v in &mut __struct.satellite_prn {
14384 let val = buf.get_u8();
14385 *v = val;
14386 }
14387 for v in &mut __struct.satellite_used {
14388 let val = buf.get_u8();
14389 *v = val;
14390 }
14391 for v in &mut __struct.satellite_elevation {
14392 let val = buf.get_u8();
14393 *v = val;
14394 }
14395 for v in &mut __struct.satellite_azimuth {
14396 let val = buf.get_u8();
14397 *v = val;
14398 }
14399 for v in &mut __struct.satellite_snr {
14400 let val = buf.get_u8();
14401 *v = val;
14402 }
14403 Ok(__struct)
14404 }
14405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14406 let mut __tmp = BytesMut::new(bytes);
14407 #[allow(clippy::absurd_extreme_comparisons)]
14408 #[allow(unused_comparisons)]
14409 if __tmp.remaining() < Self::ENCODED_LEN {
14410 panic!(
14411 "buffer is too small (need {} bytes, but got {})",
14412 Self::ENCODED_LEN,
14413 __tmp.remaining(),
14414 )
14415 }
14416 __tmp.put_u8(self.satellites_visible);
14417 for val in &self.satellite_prn {
14418 __tmp.put_u8(*val);
14419 }
14420 for val in &self.satellite_used {
14421 __tmp.put_u8(*val);
14422 }
14423 for val in &self.satellite_elevation {
14424 __tmp.put_u8(*val);
14425 }
14426 for val in &self.satellite_azimuth {
14427 __tmp.put_u8(*val);
14428 }
14429 for val in &self.satellite_snr {
14430 __tmp.put_u8(*val);
14431 }
14432 if matches!(version, MavlinkVersion::V2) {
14433 let len = __tmp.len();
14434 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14435 } else {
14436 __tmp.len()
14437 }
14438 }
14439}
14440#[doc = "id: 0"]
14441#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14442#[derive(Debug, Clone, PartialEq)]
14443#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14444#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14445pub struct HEARTBEAT_DATA {
14446 #[doc = "A bitfield for use for autopilot-specific flags"]
14447 pub custom_mode: u32,
14448 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14449 pub mavtype: MavType,
14450 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14451 pub autopilot: MavAutopilot,
14452 #[doc = "System mode bitmap."]
14453 pub base_mode: MavModeFlag,
14454 #[doc = "System status flag."]
14455 pub system_status: MavState,
14456 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14457 pub mavlink_version: u8,
14458}
14459impl HEARTBEAT_DATA {
14460 pub const ENCODED_LEN: usize = 9usize;
14461 pub const DEFAULT: Self = Self {
14462 custom_mode: 0_u32,
14463 mavtype: MavType::DEFAULT,
14464 autopilot: MavAutopilot::DEFAULT,
14465 base_mode: MavModeFlag::DEFAULT,
14466 system_status: MavState::DEFAULT,
14467 mavlink_version: 0_u8,
14468 };
14469 #[cfg(feature = "arbitrary")]
14470 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14471 use arbitrary::{Arbitrary, Unstructured};
14472 let mut buf = [0u8; 1024];
14473 rng.fill_bytes(&mut buf);
14474 let mut unstructured = Unstructured::new(&buf);
14475 Self::arbitrary(&mut unstructured).unwrap_or_default()
14476 }
14477}
14478impl Default for HEARTBEAT_DATA {
14479 fn default() -> Self {
14480 Self::DEFAULT.clone()
14481 }
14482}
14483impl MessageData for HEARTBEAT_DATA {
14484 type Message = MavMessage;
14485 const ID: u32 = 0u32;
14486 const NAME: &'static str = "HEARTBEAT";
14487 const EXTRA_CRC: u8 = 50u8;
14488 const ENCODED_LEN: usize = 9usize;
14489 fn deser(
14490 _version: MavlinkVersion,
14491 __input: &[u8],
14492 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14493 let avail_len = __input.len();
14494 let mut payload_buf = [0; Self::ENCODED_LEN];
14495 let mut buf = if avail_len < Self::ENCODED_LEN {
14496 payload_buf[0..avail_len].copy_from_slice(__input);
14497 Bytes::new(&payload_buf)
14498 } else {
14499 Bytes::new(__input)
14500 };
14501 let mut __struct = Self::default();
14502 __struct.custom_mode = buf.get_u32_le();
14503 let tmp = buf.get_u8();
14504 __struct.mavtype =
14505 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14506 enum_type: "MavType",
14507 value: tmp as u32,
14508 })?;
14509 let tmp = buf.get_u8();
14510 __struct.autopilot =
14511 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14512 enum_type: "MavAutopilot",
14513 value: tmp as u32,
14514 })?;
14515 let tmp = buf.get_u8();
14516 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14517 ::mavlink_core::error::ParserError::InvalidFlag {
14518 flag_type: "MavModeFlag",
14519 value: tmp as u32,
14520 },
14521 )?;
14522 let tmp = buf.get_u8();
14523 __struct.system_status =
14524 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14525 enum_type: "MavState",
14526 value: tmp as u32,
14527 })?;
14528 __struct.mavlink_version = buf.get_u8();
14529 Ok(__struct)
14530 }
14531 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14532 let mut __tmp = BytesMut::new(bytes);
14533 #[allow(clippy::absurd_extreme_comparisons)]
14534 #[allow(unused_comparisons)]
14535 if __tmp.remaining() < Self::ENCODED_LEN {
14536 panic!(
14537 "buffer is too small (need {} bytes, but got {})",
14538 Self::ENCODED_LEN,
14539 __tmp.remaining(),
14540 )
14541 }
14542 __tmp.put_u32_le(self.custom_mode);
14543 __tmp.put_u8(self.mavtype as u8);
14544 __tmp.put_u8(self.autopilot as u8);
14545 __tmp.put_u8(self.base_mode.bits());
14546 __tmp.put_u8(self.system_status as u8);
14547 __tmp.put_u8(self.mavlink_version);
14548 if matches!(version, MavlinkVersion::V2) {
14549 let len = __tmp.len();
14550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14551 } else {
14552 __tmp.len()
14553 }
14554 }
14555}
14556#[doc = "id: 105"]
14557#[doc = "The IMU readings in SI units in NED body frame."]
14558#[derive(Debug, Clone, PartialEq)]
14559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14561pub struct HIGHRES_IMU_DATA {
14562 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14563 pub time_usec: u64,
14564 #[doc = "X acceleration"]
14565 pub xacc: f32,
14566 #[doc = "Y acceleration"]
14567 pub yacc: f32,
14568 #[doc = "Z acceleration"]
14569 pub zacc: f32,
14570 #[doc = "Angular speed around X axis"]
14571 pub xgyro: f32,
14572 #[doc = "Angular speed around Y axis"]
14573 pub ygyro: f32,
14574 #[doc = "Angular speed around Z axis"]
14575 pub zgyro: f32,
14576 #[doc = "X Magnetic field"]
14577 pub xmag: f32,
14578 #[doc = "Y Magnetic field"]
14579 pub ymag: f32,
14580 #[doc = "Z Magnetic field"]
14581 pub zmag: f32,
14582 #[doc = "Absolute pressure"]
14583 pub abs_pressure: f32,
14584 #[doc = "Differential pressure"]
14585 pub diff_pressure: f32,
14586 #[doc = "Altitude calculated from pressure"]
14587 pub pressure_alt: f32,
14588 #[doc = "Temperature"]
14589 pub temperature: f32,
14590 #[doc = "Bitmap for fields that have updated since last message"]
14591 pub fields_updated: HighresImuUpdatedFlags,
14592 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14593 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14594 pub id: u8,
14595}
14596impl HIGHRES_IMU_DATA {
14597 pub const ENCODED_LEN: usize = 63usize;
14598 pub const DEFAULT: Self = Self {
14599 time_usec: 0_u64,
14600 xacc: 0.0_f32,
14601 yacc: 0.0_f32,
14602 zacc: 0.0_f32,
14603 xgyro: 0.0_f32,
14604 ygyro: 0.0_f32,
14605 zgyro: 0.0_f32,
14606 xmag: 0.0_f32,
14607 ymag: 0.0_f32,
14608 zmag: 0.0_f32,
14609 abs_pressure: 0.0_f32,
14610 diff_pressure: 0.0_f32,
14611 pressure_alt: 0.0_f32,
14612 temperature: 0.0_f32,
14613 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14614 id: 0_u8,
14615 };
14616 #[cfg(feature = "arbitrary")]
14617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14618 use arbitrary::{Arbitrary, Unstructured};
14619 let mut buf = [0u8; 1024];
14620 rng.fill_bytes(&mut buf);
14621 let mut unstructured = Unstructured::new(&buf);
14622 Self::arbitrary(&mut unstructured).unwrap_or_default()
14623 }
14624}
14625impl Default for HIGHRES_IMU_DATA {
14626 fn default() -> Self {
14627 Self::DEFAULT.clone()
14628 }
14629}
14630impl MessageData for HIGHRES_IMU_DATA {
14631 type Message = MavMessage;
14632 const ID: u32 = 105u32;
14633 const NAME: &'static str = "HIGHRES_IMU";
14634 const EXTRA_CRC: u8 = 93u8;
14635 const ENCODED_LEN: usize = 63usize;
14636 fn deser(
14637 _version: MavlinkVersion,
14638 __input: &[u8],
14639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14640 let avail_len = __input.len();
14641 let mut payload_buf = [0; Self::ENCODED_LEN];
14642 let mut buf = if avail_len < Self::ENCODED_LEN {
14643 payload_buf[0..avail_len].copy_from_slice(__input);
14644 Bytes::new(&payload_buf)
14645 } else {
14646 Bytes::new(__input)
14647 };
14648 let mut __struct = Self::default();
14649 __struct.time_usec = buf.get_u64_le();
14650 __struct.xacc = buf.get_f32_le();
14651 __struct.yacc = buf.get_f32_le();
14652 __struct.zacc = buf.get_f32_le();
14653 __struct.xgyro = buf.get_f32_le();
14654 __struct.ygyro = buf.get_f32_le();
14655 __struct.zgyro = buf.get_f32_le();
14656 __struct.xmag = buf.get_f32_le();
14657 __struct.ymag = buf.get_f32_le();
14658 __struct.zmag = buf.get_f32_le();
14659 __struct.abs_pressure = buf.get_f32_le();
14660 __struct.diff_pressure = buf.get_f32_le();
14661 __struct.pressure_alt = buf.get_f32_le();
14662 __struct.temperature = buf.get_f32_le();
14663 let tmp = buf.get_u16_le();
14664 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
14665 tmp & HighresImuUpdatedFlags::all().bits(),
14666 )
14667 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14668 flag_type: "HighresImuUpdatedFlags",
14669 value: tmp as u32,
14670 })?;
14671 __struct.id = buf.get_u8();
14672 Ok(__struct)
14673 }
14674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14675 let mut __tmp = BytesMut::new(bytes);
14676 #[allow(clippy::absurd_extreme_comparisons)]
14677 #[allow(unused_comparisons)]
14678 if __tmp.remaining() < Self::ENCODED_LEN {
14679 panic!(
14680 "buffer is too small (need {} bytes, but got {})",
14681 Self::ENCODED_LEN,
14682 __tmp.remaining(),
14683 )
14684 }
14685 __tmp.put_u64_le(self.time_usec);
14686 __tmp.put_f32_le(self.xacc);
14687 __tmp.put_f32_le(self.yacc);
14688 __tmp.put_f32_le(self.zacc);
14689 __tmp.put_f32_le(self.xgyro);
14690 __tmp.put_f32_le(self.ygyro);
14691 __tmp.put_f32_le(self.zgyro);
14692 __tmp.put_f32_le(self.xmag);
14693 __tmp.put_f32_le(self.ymag);
14694 __tmp.put_f32_le(self.zmag);
14695 __tmp.put_f32_le(self.abs_pressure);
14696 __tmp.put_f32_le(self.diff_pressure);
14697 __tmp.put_f32_le(self.pressure_alt);
14698 __tmp.put_f32_le(self.temperature);
14699 __tmp.put_u16_le(self.fields_updated.bits());
14700 __tmp.put_u8(self.id);
14701 if matches!(version, MavlinkVersion::V2) {
14702 let len = __tmp.len();
14703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14704 } else {
14705 __tmp.len()
14706 }
14707 }
14708}
14709#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
14710#[doc = "id: 234"]
14711#[doc = "Message appropriate for high latency connections like Iridium."]
14712#[derive(Debug, Clone, PartialEq)]
14713#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14715pub struct HIGH_LATENCY_DATA {
14716 #[doc = "A bitfield for use for autopilot-specific flags."]
14717 pub custom_mode: u32,
14718 #[doc = "Latitude"]
14719 pub latitude: i32,
14720 #[doc = "Longitude"]
14721 pub longitude: i32,
14722 #[doc = "roll"]
14723 pub roll: i16,
14724 #[doc = "pitch"]
14725 pub pitch: i16,
14726 #[doc = "heading"]
14727 pub heading: u16,
14728 #[doc = "heading setpoint"]
14729 pub heading_sp: i16,
14730 #[doc = "Altitude above mean sea level"]
14731 pub altitude_amsl: i16,
14732 #[doc = "Altitude setpoint relative to the home position"]
14733 pub altitude_sp: i16,
14734 #[doc = "distance to target"]
14735 pub wp_distance: u16,
14736 #[doc = "Bitmap of enabled system modes."]
14737 pub base_mode: MavModeFlag,
14738 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
14739 pub landed_state: MavLandedState,
14740 #[doc = "throttle (percentage)"]
14741 pub throttle: i8,
14742 #[doc = "airspeed"]
14743 pub airspeed: u8,
14744 #[doc = "airspeed setpoint"]
14745 pub airspeed_sp: u8,
14746 #[doc = "groundspeed"]
14747 pub groundspeed: u8,
14748 #[doc = "climb rate"]
14749 pub climb_rate: i8,
14750 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14751 pub gps_nsat: u8,
14752 #[doc = "GPS Fix type."]
14753 pub gps_fix_type: GpsFixType,
14754 #[doc = "Remaining battery (percentage)"]
14755 pub battery_remaining: u8,
14756 #[doc = "Autopilot temperature (degrees C)"]
14757 pub temperature: i8,
14758 #[doc = "Air temperature (degrees C) from airspeed sensor"]
14759 pub temperature_air: i8,
14760 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
14761 pub failsafe: u8,
14762 #[doc = "current waypoint number"]
14763 pub wp_num: u8,
14764}
14765impl HIGH_LATENCY_DATA {
14766 pub const ENCODED_LEN: usize = 40usize;
14767 pub const DEFAULT: Self = Self {
14768 custom_mode: 0_u32,
14769 latitude: 0_i32,
14770 longitude: 0_i32,
14771 roll: 0_i16,
14772 pitch: 0_i16,
14773 heading: 0_u16,
14774 heading_sp: 0_i16,
14775 altitude_amsl: 0_i16,
14776 altitude_sp: 0_i16,
14777 wp_distance: 0_u16,
14778 base_mode: MavModeFlag::DEFAULT,
14779 landed_state: MavLandedState::DEFAULT,
14780 throttle: 0_i8,
14781 airspeed: 0_u8,
14782 airspeed_sp: 0_u8,
14783 groundspeed: 0_u8,
14784 climb_rate: 0_i8,
14785 gps_nsat: 0_u8,
14786 gps_fix_type: GpsFixType::DEFAULT,
14787 battery_remaining: 0_u8,
14788 temperature: 0_i8,
14789 temperature_air: 0_i8,
14790 failsafe: 0_u8,
14791 wp_num: 0_u8,
14792 };
14793 #[cfg(feature = "arbitrary")]
14794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14795 use arbitrary::{Arbitrary, Unstructured};
14796 let mut buf = [0u8; 1024];
14797 rng.fill_bytes(&mut buf);
14798 let mut unstructured = Unstructured::new(&buf);
14799 Self::arbitrary(&mut unstructured).unwrap_or_default()
14800 }
14801}
14802impl Default for HIGH_LATENCY_DATA {
14803 fn default() -> Self {
14804 Self::DEFAULT.clone()
14805 }
14806}
14807impl MessageData for HIGH_LATENCY_DATA {
14808 type Message = MavMessage;
14809 const ID: u32 = 234u32;
14810 const NAME: &'static str = "HIGH_LATENCY";
14811 const EXTRA_CRC: u8 = 150u8;
14812 const ENCODED_LEN: usize = 40usize;
14813 fn deser(
14814 _version: MavlinkVersion,
14815 __input: &[u8],
14816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14817 let avail_len = __input.len();
14818 let mut payload_buf = [0; Self::ENCODED_LEN];
14819 let mut buf = if avail_len < Self::ENCODED_LEN {
14820 payload_buf[0..avail_len].copy_from_slice(__input);
14821 Bytes::new(&payload_buf)
14822 } else {
14823 Bytes::new(__input)
14824 };
14825 let mut __struct = Self::default();
14826 __struct.custom_mode = buf.get_u32_le();
14827 __struct.latitude = buf.get_i32_le();
14828 __struct.longitude = buf.get_i32_le();
14829 __struct.roll = buf.get_i16_le();
14830 __struct.pitch = buf.get_i16_le();
14831 __struct.heading = buf.get_u16_le();
14832 __struct.heading_sp = buf.get_i16_le();
14833 __struct.altitude_amsl = buf.get_i16_le();
14834 __struct.altitude_sp = buf.get_i16_le();
14835 __struct.wp_distance = buf.get_u16_le();
14836 let tmp = buf.get_u8();
14837 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14838 ::mavlink_core::error::ParserError::InvalidFlag {
14839 flag_type: "MavModeFlag",
14840 value: tmp as u32,
14841 },
14842 )?;
14843 let tmp = buf.get_u8();
14844 __struct.landed_state =
14845 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14846 enum_type: "MavLandedState",
14847 value: tmp as u32,
14848 })?;
14849 __struct.throttle = buf.get_i8();
14850 __struct.airspeed = buf.get_u8();
14851 __struct.airspeed_sp = buf.get_u8();
14852 __struct.groundspeed = buf.get_u8();
14853 __struct.climb_rate = buf.get_i8();
14854 __struct.gps_nsat = buf.get_u8();
14855 let tmp = buf.get_u8();
14856 __struct.gps_fix_type =
14857 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14858 enum_type: "GpsFixType",
14859 value: tmp as u32,
14860 })?;
14861 __struct.battery_remaining = buf.get_u8();
14862 __struct.temperature = buf.get_i8();
14863 __struct.temperature_air = buf.get_i8();
14864 __struct.failsafe = buf.get_u8();
14865 __struct.wp_num = buf.get_u8();
14866 Ok(__struct)
14867 }
14868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14869 let mut __tmp = BytesMut::new(bytes);
14870 #[allow(clippy::absurd_extreme_comparisons)]
14871 #[allow(unused_comparisons)]
14872 if __tmp.remaining() < Self::ENCODED_LEN {
14873 panic!(
14874 "buffer is too small (need {} bytes, but got {})",
14875 Self::ENCODED_LEN,
14876 __tmp.remaining(),
14877 )
14878 }
14879 __tmp.put_u32_le(self.custom_mode);
14880 __tmp.put_i32_le(self.latitude);
14881 __tmp.put_i32_le(self.longitude);
14882 __tmp.put_i16_le(self.roll);
14883 __tmp.put_i16_le(self.pitch);
14884 __tmp.put_u16_le(self.heading);
14885 __tmp.put_i16_le(self.heading_sp);
14886 __tmp.put_i16_le(self.altitude_amsl);
14887 __tmp.put_i16_le(self.altitude_sp);
14888 __tmp.put_u16_le(self.wp_distance);
14889 __tmp.put_u8(self.base_mode.bits());
14890 __tmp.put_u8(self.landed_state as u8);
14891 __tmp.put_i8(self.throttle);
14892 __tmp.put_u8(self.airspeed);
14893 __tmp.put_u8(self.airspeed_sp);
14894 __tmp.put_u8(self.groundspeed);
14895 __tmp.put_i8(self.climb_rate);
14896 __tmp.put_u8(self.gps_nsat);
14897 __tmp.put_u8(self.gps_fix_type as u8);
14898 __tmp.put_u8(self.battery_remaining);
14899 __tmp.put_i8(self.temperature);
14900 __tmp.put_i8(self.temperature_air);
14901 __tmp.put_u8(self.failsafe);
14902 __tmp.put_u8(self.wp_num);
14903 if matches!(version, MavlinkVersion::V2) {
14904 let len = __tmp.len();
14905 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14906 } else {
14907 __tmp.len()
14908 }
14909 }
14910}
14911#[doc = "id: 235"]
14912#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
14913#[derive(Debug, Clone, PartialEq)]
14914#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14915#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14916pub struct HIGH_LATENCY2_DATA {
14917 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
14918 pub timestamp: u32,
14919 #[doc = "Latitude"]
14920 pub latitude: i32,
14921 #[doc = "Longitude"]
14922 pub longitude: i32,
14923 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
14924 pub custom_mode: u16,
14925 #[doc = "Altitude above mean sea level"]
14926 pub altitude: i16,
14927 #[doc = "Altitude setpoint"]
14928 pub target_altitude: i16,
14929 #[doc = "Distance to target waypoint or position"]
14930 pub target_distance: u16,
14931 #[doc = "Current waypoint number"]
14932 pub wp_num: u16,
14933 #[doc = "Bitmap of failure flags."]
14934 pub failure_flags: HlFailureFlag,
14935 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
14936 pub mavtype: MavType,
14937 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14938 pub autopilot: MavAutopilot,
14939 #[doc = "Heading"]
14940 pub heading: u8,
14941 #[doc = "Heading setpoint"]
14942 pub target_heading: u8,
14943 #[doc = "Throttle"]
14944 pub throttle: u8,
14945 #[doc = "Airspeed"]
14946 pub airspeed: u8,
14947 #[doc = "Airspeed setpoint"]
14948 pub airspeed_sp: u8,
14949 #[doc = "Groundspeed"]
14950 pub groundspeed: u8,
14951 #[doc = "Windspeed"]
14952 pub windspeed: u8,
14953 #[doc = "Wind heading"]
14954 pub wind_heading: u8,
14955 #[doc = "Maximum error horizontal position since last message"]
14956 pub eph: u8,
14957 #[doc = "Maximum error vertical position since last message"]
14958 pub epv: u8,
14959 #[doc = "Air temperature"]
14960 pub temperature_air: i8,
14961 #[doc = "Maximum climb rate magnitude since last message"]
14962 pub climb_rate: i8,
14963 #[doc = "Battery level (-1 if field not provided)."]
14964 pub battery: i8,
14965 #[doc = "Field for custom payload."]
14966 pub custom0: i8,
14967 #[doc = "Field for custom payload."]
14968 pub custom1: i8,
14969 #[doc = "Field for custom payload."]
14970 pub custom2: i8,
14971}
14972impl HIGH_LATENCY2_DATA {
14973 pub const ENCODED_LEN: usize = 42usize;
14974 pub const DEFAULT: Self = Self {
14975 timestamp: 0_u32,
14976 latitude: 0_i32,
14977 longitude: 0_i32,
14978 custom_mode: 0_u16,
14979 altitude: 0_i16,
14980 target_altitude: 0_i16,
14981 target_distance: 0_u16,
14982 wp_num: 0_u16,
14983 failure_flags: HlFailureFlag::DEFAULT,
14984 mavtype: MavType::DEFAULT,
14985 autopilot: MavAutopilot::DEFAULT,
14986 heading: 0_u8,
14987 target_heading: 0_u8,
14988 throttle: 0_u8,
14989 airspeed: 0_u8,
14990 airspeed_sp: 0_u8,
14991 groundspeed: 0_u8,
14992 windspeed: 0_u8,
14993 wind_heading: 0_u8,
14994 eph: 0_u8,
14995 epv: 0_u8,
14996 temperature_air: 0_i8,
14997 climb_rate: 0_i8,
14998 battery: 0_i8,
14999 custom0: 0_i8,
15000 custom1: 0_i8,
15001 custom2: 0_i8,
15002 };
15003 #[cfg(feature = "arbitrary")]
15004 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15005 use arbitrary::{Arbitrary, Unstructured};
15006 let mut buf = [0u8; 1024];
15007 rng.fill_bytes(&mut buf);
15008 let mut unstructured = Unstructured::new(&buf);
15009 Self::arbitrary(&mut unstructured).unwrap_or_default()
15010 }
15011}
15012impl Default for HIGH_LATENCY2_DATA {
15013 fn default() -> Self {
15014 Self::DEFAULT.clone()
15015 }
15016}
15017impl MessageData for HIGH_LATENCY2_DATA {
15018 type Message = MavMessage;
15019 const ID: u32 = 235u32;
15020 const NAME: &'static str = "HIGH_LATENCY2";
15021 const EXTRA_CRC: u8 = 179u8;
15022 const ENCODED_LEN: usize = 42usize;
15023 fn deser(
15024 _version: MavlinkVersion,
15025 __input: &[u8],
15026 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15027 let avail_len = __input.len();
15028 let mut payload_buf = [0; Self::ENCODED_LEN];
15029 let mut buf = if avail_len < Self::ENCODED_LEN {
15030 payload_buf[0..avail_len].copy_from_slice(__input);
15031 Bytes::new(&payload_buf)
15032 } else {
15033 Bytes::new(__input)
15034 };
15035 let mut __struct = Self::default();
15036 __struct.timestamp = buf.get_u32_le();
15037 __struct.latitude = buf.get_i32_le();
15038 __struct.longitude = buf.get_i32_le();
15039 __struct.custom_mode = buf.get_u16_le();
15040 __struct.altitude = buf.get_i16_le();
15041 __struct.target_altitude = buf.get_i16_le();
15042 __struct.target_distance = buf.get_u16_le();
15043 __struct.wp_num = buf.get_u16_le();
15044 let tmp = buf.get_u16_le();
15045 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15046 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15047 flag_type: "HlFailureFlag",
15048 value: tmp as u32,
15049 })?;
15050 let tmp = buf.get_u8();
15051 __struct.mavtype =
15052 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15053 enum_type: "MavType",
15054 value: tmp as u32,
15055 })?;
15056 let tmp = buf.get_u8();
15057 __struct.autopilot =
15058 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15059 enum_type: "MavAutopilot",
15060 value: tmp as u32,
15061 })?;
15062 __struct.heading = buf.get_u8();
15063 __struct.target_heading = buf.get_u8();
15064 __struct.throttle = buf.get_u8();
15065 __struct.airspeed = buf.get_u8();
15066 __struct.airspeed_sp = buf.get_u8();
15067 __struct.groundspeed = buf.get_u8();
15068 __struct.windspeed = buf.get_u8();
15069 __struct.wind_heading = buf.get_u8();
15070 __struct.eph = buf.get_u8();
15071 __struct.epv = buf.get_u8();
15072 __struct.temperature_air = buf.get_i8();
15073 __struct.climb_rate = buf.get_i8();
15074 __struct.battery = buf.get_i8();
15075 __struct.custom0 = buf.get_i8();
15076 __struct.custom1 = buf.get_i8();
15077 __struct.custom2 = buf.get_i8();
15078 Ok(__struct)
15079 }
15080 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15081 let mut __tmp = BytesMut::new(bytes);
15082 #[allow(clippy::absurd_extreme_comparisons)]
15083 #[allow(unused_comparisons)]
15084 if __tmp.remaining() < Self::ENCODED_LEN {
15085 panic!(
15086 "buffer is too small (need {} bytes, but got {})",
15087 Self::ENCODED_LEN,
15088 __tmp.remaining(),
15089 )
15090 }
15091 __tmp.put_u32_le(self.timestamp);
15092 __tmp.put_i32_le(self.latitude);
15093 __tmp.put_i32_le(self.longitude);
15094 __tmp.put_u16_le(self.custom_mode);
15095 __tmp.put_i16_le(self.altitude);
15096 __tmp.put_i16_le(self.target_altitude);
15097 __tmp.put_u16_le(self.target_distance);
15098 __tmp.put_u16_le(self.wp_num);
15099 __tmp.put_u16_le(self.failure_flags.bits());
15100 __tmp.put_u8(self.mavtype as u8);
15101 __tmp.put_u8(self.autopilot as u8);
15102 __tmp.put_u8(self.heading);
15103 __tmp.put_u8(self.target_heading);
15104 __tmp.put_u8(self.throttle);
15105 __tmp.put_u8(self.airspeed);
15106 __tmp.put_u8(self.airspeed_sp);
15107 __tmp.put_u8(self.groundspeed);
15108 __tmp.put_u8(self.windspeed);
15109 __tmp.put_u8(self.wind_heading);
15110 __tmp.put_u8(self.eph);
15111 __tmp.put_u8(self.epv);
15112 __tmp.put_i8(self.temperature_air);
15113 __tmp.put_i8(self.climb_rate);
15114 __tmp.put_i8(self.battery);
15115 __tmp.put_i8(self.custom0);
15116 __tmp.put_i8(self.custom1);
15117 __tmp.put_i8(self.custom2);
15118 if matches!(version, MavlinkVersion::V2) {
15119 let len = __tmp.len();
15120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15121 } else {
15122 __tmp.len()
15123 }
15124 }
15125}
15126#[doc = "id: 93"]
15127#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15128#[derive(Debug, Clone, PartialEq)]
15129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15131pub struct HIL_ACTUATOR_CONTROLS_DATA {
15132 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15133 pub time_usec: u64,
15134 #[doc = "Flags bitmask."]
15135 pub flags: HilActuatorControlsFlags,
15136 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15137 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15138 pub controls: [f32; 16],
15139 #[doc = "System mode. Includes arming state."]
15140 pub mode: MavModeFlag,
15141}
15142impl HIL_ACTUATOR_CONTROLS_DATA {
15143 pub const ENCODED_LEN: usize = 81usize;
15144 pub const DEFAULT: Self = Self {
15145 time_usec: 0_u64,
15146 flags: HilActuatorControlsFlags::DEFAULT,
15147 controls: [0.0_f32; 16usize],
15148 mode: MavModeFlag::DEFAULT,
15149 };
15150 #[cfg(feature = "arbitrary")]
15151 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15152 use arbitrary::{Arbitrary, Unstructured};
15153 let mut buf = [0u8; 1024];
15154 rng.fill_bytes(&mut buf);
15155 let mut unstructured = Unstructured::new(&buf);
15156 Self::arbitrary(&mut unstructured).unwrap_or_default()
15157 }
15158}
15159impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15160 fn default() -> Self {
15161 Self::DEFAULT.clone()
15162 }
15163}
15164impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15165 type Message = MavMessage;
15166 const ID: u32 = 93u32;
15167 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15168 const EXTRA_CRC: u8 = 47u8;
15169 const ENCODED_LEN: usize = 81usize;
15170 fn deser(
15171 _version: MavlinkVersion,
15172 __input: &[u8],
15173 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15174 let avail_len = __input.len();
15175 let mut payload_buf = [0; Self::ENCODED_LEN];
15176 let mut buf = if avail_len < Self::ENCODED_LEN {
15177 payload_buf[0..avail_len].copy_from_slice(__input);
15178 Bytes::new(&payload_buf)
15179 } else {
15180 Bytes::new(__input)
15181 };
15182 let mut __struct = Self::default();
15183 __struct.time_usec = buf.get_u64_le();
15184 let tmp = buf.get_u64_le();
15185 __struct.flags =
15186 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15187 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15188 flag_type: "HilActuatorControlsFlags",
15189 value: tmp as u32,
15190 })?;
15191 for v in &mut __struct.controls {
15192 let val = buf.get_f32_le();
15193 *v = val;
15194 }
15195 let tmp = buf.get_u8();
15196 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15197 ::mavlink_core::error::ParserError::InvalidFlag {
15198 flag_type: "MavModeFlag",
15199 value: tmp as u32,
15200 },
15201 )?;
15202 Ok(__struct)
15203 }
15204 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15205 let mut __tmp = BytesMut::new(bytes);
15206 #[allow(clippy::absurd_extreme_comparisons)]
15207 #[allow(unused_comparisons)]
15208 if __tmp.remaining() < Self::ENCODED_LEN {
15209 panic!(
15210 "buffer is too small (need {} bytes, but got {})",
15211 Self::ENCODED_LEN,
15212 __tmp.remaining(),
15213 )
15214 }
15215 __tmp.put_u64_le(self.time_usec);
15216 __tmp.put_u64_le(self.flags.bits());
15217 for val in &self.controls {
15218 __tmp.put_f32_le(*val);
15219 }
15220 __tmp.put_u8(self.mode.bits());
15221 if matches!(version, MavlinkVersion::V2) {
15222 let len = __tmp.len();
15223 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15224 } else {
15225 __tmp.len()
15226 }
15227 }
15228}
15229#[doc = "id: 91"]
15230#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15231#[derive(Debug, Clone, PartialEq)]
15232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15234pub struct HIL_CONTROLS_DATA {
15235 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15236 pub time_usec: u64,
15237 #[doc = "Control output -1 .. 1"]
15238 pub roll_ailerons: f32,
15239 #[doc = "Control output -1 .. 1"]
15240 pub pitch_elevator: f32,
15241 #[doc = "Control output -1 .. 1"]
15242 pub yaw_rudder: f32,
15243 #[doc = "Throttle 0 .. 1"]
15244 pub throttle: f32,
15245 #[doc = "Aux 1, -1 .. 1"]
15246 pub aux1: f32,
15247 #[doc = "Aux 2, -1 .. 1"]
15248 pub aux2: f32,
15249 #[doc = "Aux 3, -1 .. 1"]
15250 pub aux3: f32,
15251 #[doc = "Aux 4, -1 .. 1"]
15252 pub aux4: f32,
15253 #[doc = "System mode."]
15254 pub mode: MavMode,
15255 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15256 pub nav_mode: u8,
15257}
15258impl HIL_CONTROLS_DATA {
15259 pub const ENCODED_LEN: usize = 42usize;
15260 pub const DEFAULT: Self = Self {
15261 time_usec: 0_u64,
15262 roll_ailerons: 0.0_f32,
15263 pitch_elevator: 0.0_f32,
15264 yaw_rudder: 0.0_f32,
15265 throttle: 0.0_f32,
15266 aux1: 0.0_f32,
15267 aux2: 0.0_f32,
15268 aux3: 0.0_f32,
15269 aux4: 0.0_f32,
15270 mode: MavMode::DEFAULT,
15271 nav_mode: 0_u8,
15272 };
15273 #[cfg(feature = "arbitrary")]
15274 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15275 use arbitrary::{Arbitrary, Unstructured};
15276 let mut buf = [0u8; 1024];
15277 rng.fill_bytes(&mut buf);
15278 let mut unstructured = Unstructured::new(&buf);
15279 Self::arbitrary(&mut unstructured).unwrap_or_default()
15280 }
15281}
15282impl Default for HIL_CONTROLS_DATA {
15283 fn default() -> Self {
15284 Self::DEFAULT.clone()
15285 }
15286}
15287impl MessageData for HIL_CONTROLS_DATA {
15288 type Message = MavMessage;
15289 const ID: u32 = 91u32;
15290 const NAME: &'static str = "HIL_CONTROLS";
15291 const EXTRA_CRC: u8 = 63u8;
15292 const ENCODED_LEN: usize = 42usize;
15293 fn deser(
15294 _version: MavlinkVersion,
15295 __input: &[u8],
15296 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15297 let avail_len = __input.len();
15298 let mut payload_buf = [0; Self::ENCODED_LEN];
15299 let mut buf = if avail_len < Self::ENCODED_LEN {
15300 payload_buf[0..avail_len].copy_from_slice(__input);
15301 Bytes::new(&payload_buf)
15302 } else {
15303 Bytes::new(__input)
15304 };
15305 let mut __struct = Self::default();
15306 __struct.time_usec = buf.get_u64_le();
15307 __struct.roll_ailerons = buf.get_f32_le();
15308 __struct.pitch_elevator = buf.get_f32_le();
15309 __struct.yaw_rudder = buf.get_f32_le();
15310 __struct.throttle = buf.get_f32_le();
15311 __struct.aux1 = buf.get_f32_le();
15312 __struct.aux2 = buf.get_f32_le();
15313 __struct.aux3 = buf.get_f32_le();
15314 __struct.aux4 = buf.get_f32_le();
15315 let tmp = buf.get_u8();
15316 __struct.mode =
15317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15318 enum_type: "MavMode",
15319 value: tmp as u32,
15320 })?;
15321 __struct.nav_mode = buf.get_u8();
15322 Ok(__struct)
15323 }
15324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15325 let mut __tmp = BytesMut::new(bytes);
15326 #[allow(clippy::absurd_extreme_comparisons)]
15327 #[allow(unused_comparisons)]
15328 if __tmp.remaining() < Self::ENCODED_LEN {
15329 panic!(
15330 "buffer is too small (need {} bytes, but got {})",
15331 Self::ENCODED_LEN,
15332 __tmp.remaining(),
15333 )
15334 }
15335 __tmp.put_u64_le(self.time_usec);
15336 __tmp.put_f32_le(self.roll_ailerons);
15337 __tmp.put_f32_le(self.pitch_elevator);
15338 __tmp.put_f32_le(self.yaw_rudder);
15339 __tmp.put_f32_le(self.throttle);
15340 __tmp.put_f32_le(self.aux1);
15341 __tmp.put_f32_le(self.aux2);
15342 __tmp.put_f32_le(self.aux3);
15343 __tmp.put_f32_le(self.aux4);
15344 __tmp.put_u8(self.mode as u8);
15345 __tmp.put_u8(self.nav_mode);
15346 if matches!(version, MavlinkVersion::V2) {
15347 let len = __tmp.len();
15348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15349 } else {
15350 __tmp.len()
15351 }
15352 }
15353}
15354#[doc = "id: 113"]
15355#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15356#[derive(Debug, Clone, PartialEq)]
15357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15358#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15359pub struct HIL_GPS_DATA {
15360 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15361 pub time_usec: u64,
15362 #[doc = "Latitude (WGS84)"]
15363 pub lat: i32,
15364 #[doc = "Longitude (WGS84)"]
15365 pub lon: i32,
15366 #[doc = "Altitude (MSL). Positive for up."]
15367 pub alt: i32,
15368 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15369 pub eph: u16,
15370 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15371 pub epv: u16,
15372 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15373 pub vel: u16,
15374 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15375 pub vn: i16,
15376 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15377 pub ve: i16,
15378 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15379 pub vd: i16,
15380 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15381 pub cog: u16,
15382 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15383 pub fix_type: u8,
15384 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15385 pub satellites_visible: u8,
15386 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15387 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15388 pub id: u8,
15389 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15390 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15391 pub yaw: u16,
15392}
15393impl HIL_GPS_DATA {
15394 pub const ENCODED_LEN: usize = 39usize;
15395 pub const DEFAULT: Self = Self {
15396 time_usec: 0_u64,
15397 lat: 0_i32,
15398 lon: 0_i32,
15399 alt: 0_i32,
15400 eph: 0_u16,
15401 epv: 0_u16,
15402 vel: 0_u16,
15403 vn: 0_i16,
15404 ve: 0_i16,
15405 vd: 0_i16,
15406 cog: 0_u16,
15407 fix_type: 0_u8,
15408 satellites_visible: 0_u8,
15409 id: 0_u8,
15410 yaw: 0_u16,
15411 };
15412 #[cfg(feature = "arbitrary")]
15413 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15414 use arbitrary::{Arbitrary, Unstructured};
15415 let mut buf = [0u8; 1024];
15416 rng.fill_bytes(&mut buf);
15417 let mut unstructured = Unstructured::new(&buf);
15418 Self::arbitrary(&mut unstructured).unwrap_or_default()
15419 }
15420}
15421impl Default for HIL_GPS_DATA {
15422 fn default() -> Self {
15423 Self::DEFAULT.clone()
15424 }
15425}
15426impl MessageData for HIL_GPS_DATA {
15427 type Message = MavMessage;
15428 const ID: u32 = 113u32;
15429 const NAME: &'static str = "HIL_GPS";
15430 const EXTRA_CRC: u8 = 124u8;
15431 const ENCODED_LEN: usize = 39usize;
15432 fn deser(
15433 _version: MavlinkVersion,
15434 __input: &[u8],
15435 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15436 let avail_len = __input.len();
15437 let mut payload_buf = [0; Self::ENCODED_LEN];
15438 let mut buf = if avail_len < Self::ENCODED_LEN {
15439 payload_buf[0..avail_len].copy_from_slice(__input);
15440 Bytes::new(&payload_buf)
15441 } else {
15442 Bytes::new(__input)
15443 };
15444 let mut __struct = Self::default();
15445 __struct.time_usec = buf.get_u64_le();
15446 __struct.lat = buf.get_i32_le();
15447 __struct.lon = buf.get_i32_le();
15448 __struct.alt = buf.get_i32_le();
15449 __struct.eph = buf.get_u16_le();
15450 __struct.epv = buf.get_u16_le();
15451 __struct.vel = buf.get_u16_le();
15452 __struct.vn = buf.get_i16_le();
15453 __struct.ve = buf.get_i16_le();
15454 __struct.vd = buf.get_i16_le();
15455 __struct.cog = buf.get_u16_le();
15456 __struct.fix_type = buf.get_u8();
15457 __struct.satellites_visible = buf.get_u8();
15458 __struct.id = buf.get_u8();
15459 __struct.yaw = buf.get_u16_le();
15460 Ok(__struct)
15461 }
15462 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15463 let mut __tmp = BytesMut::new(bytes);
15464 #[allow(clippy::absurd_extreme_comparisons)]
15465 #[allow(unused_comparisons)]
15466 if __tmp.remaining() < Self::ENCODED_LEN {
15467 panic!(
15468 "buffer is too small (need {} bytes, but got {})",
15469 Self::ENCODED_LEN,
15470 __tmp.remaining(),
15471 )
15472 }
15473 __tmp.put_u64_le(self.time_usec);
15474 __tmp.put_i32_le(self.lat);
15475 __tmp.put_i32_le(self.lon);
15476 __tmp.put_i32_le(self.alt);
15477 __tmp.put_u16_le(self.eph);
15478 __tmp.put_u16_le(self.epv);
15479 __tmp.put_u16_le(self.vel);
15480 __tmp.put_i16_le(self.vn);
15481 __tmp.put_i16_le(self.ve);
15482 __tmp.put_i16_le(self.vd);
15483 __tmp.put_u16_le(self.cog);
15484 __tmp.put_u8(self.fix_type);
15485 __tmp.put_u8(self.satellites_visible);
15486 __tmp.put_u8(self.id);
15487 __tmp.put_u16_le(self.yaw);
15488 if matches!(version, MavlinkVersion::V2) {
15489 let len = __tmp.len();
15490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15491 } else {
15492 __tmp.len()
15493 }
15494 }
15495}
15496#[doc = "id: 114"]
15497#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15498#[derive(Debug, Clone, PartialEq)]
15499#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15501pub struct HIL_OPTICAL_FLOW_DATA {
15502 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15503 pub time_usec: u64,
15504 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15505 pub integration_time_us: u32,
15506 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15507 pub integrated_x: f32,
15508 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15509 pub integrated_y: f32,
15510 #[doc = "RH rotation around X axis"]
15511 pub integrated_xgyro: f32,
15512 #[doc = "RH rotation around Y axis"]
15513 pub integrated_ygyro: f32,
15514 #[doc = "RH rotation around Z axis"]
15515 pub integrated_zgyro: f32,
15516 #[doc = "Time since the distance was sampled."]
15517 pub time_delta_distance_us: u32,
15518 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15519 pub distance: f32,
15520 #[doc = "Temperature"]
15521 pub temperature: i16,
15522 #[doc = "Sensor ID"]
15523 pub sensor_id: u8,
15524 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15525 pub quality: u8,
15526}
15527impl HIL_OPTICAL_FLOW_DATA {
15528 pub const ENCODED_LEN: usize = 44usize;
15529 pub const DEFAULT: Self = Self {
15530 time_usec: 0_u64,
15531 integration_time_us: 0_u32,
15532 integrated_x: 0.0_f32,
15533 integrated_y: 0.0_f32,
15534 integrated_xgyro: 0.0_f32,
15535 integrated_ygyro: 0.0_f32,
15536 integrated_zgyro: 0.0_f32,
15537 time_delta_distance_us: 0_u32,
15538 distance: 0.0_f32,
15539 temperature: 0_i16,
15540 sensor_id: 0_u8,
15541 quality: 0_u8,
15542 };
15543 #[cfg(feature = "arbitrary")]
15544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15545 use arbitrary::{Arbitrary, Unstructured};
15546 let mut buf = [0u8; 1024];
15547 rng.fill_bytes(&mut buf);
15548 let mut unstructured = Unstructured::new(&buf);
15549 Self::arbitrary(&mut unstructured).unwrap_or_default()
15550 }
15551}
15552impl Default for HIL_OPTICAL_FLOW_DATA {
15553 fn default() -> Self {
15554 Self::DEFAULT.clone()
15555 }
15556}
15557impl MessageData for HIL_OPTICAL_FLOW_DATA {
15558 type Message = MavMessage;
15559 const ID: u32 = 114u32;
15560 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15561 const EXTRA_CRC: u8 = 237u8;
15562 const ENCODED_LEN: usize = 44usize;
15563 fn deser(
15564 _version: MavlinkVersion,
15565 __input: &[u8],
15566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15567 let avail_len = __input.len();
15568 let mut payload_buf = [0; Self::ENCODED_LEN];
15569 let mut buf = if avail_len < Self::ENCODED_LEN {
15570 payload_buf[0..avail_len].copy_from_slice(__input);
15571 Bytes::new(&payload_buf)
15572 } else {
15573 Bytes::new(__input)
15574 };
15575 let mut __struct = Self::default();
15576 __struct.time_usec = buf.get_u64_le();
15577 __struct.integration_time_us = buf.get_u32_le();
15578 __struct.integrated_x = buf.get_f32_le();
15579 __struct.integrated_y = buf.get_f32_le();
15580 __struct.integrated_xgyro = buf.get_f32_le();
15581 __struct.integrated_ygyro = buf.get_f32_le();
15582 __struct.integrated_zgyro = buf.get_f32_le();
15583 __struct.time_delta_distance_us = buf.get_u32_le();
15584 __struct.distance = buf.get_f32_le();
15585 __struct.temperature = buf.get_i16_le();
15586 __struct.sensor_id = buf.get_u8();
15587 __struct.quality = buf.get_u8();
15588 Ok(__struct)
15589 }
15590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15591 let mut __tmp = BytesMut::new(bytes);
15592 #[allow(clippy::absurd_extreme_comparisons)]
15593 #[allow(unused_comparisons)]
15594 if __tmp.remaining() < Self::ENCODED_LEN {
15595 panic!(
15596 "buffer is too small (need {} bytes, but got {})",
15597 Self::ENCODED_LEN,
15598 __tmp.remaining(),
15599 )
15600 }
15601 __tmp.put_u64_le(self.time_usec);
15602 __tmp.put_u32_le(self.integration_time_us);
15603 __tmp.put_f32_le(self.integrated_x);
15604 __tmp.put_f32_le(self.integrated_y);
15605 __tmp.put_f32_le(self.integrated_xgyro);
15606 __tmp.put_f32_le(self.integrated_ygyro);
15607 __tmp.put_f32_le(self.integrated_zgyro);
15608 __tmp.put_u32_le(self.time_delta_distance_us);
15609 __tmp.put_f32_le(self.distance);
15610 __tmp.put_i16_le(self.temperature);
15611 __tmp.put_u8(self.sensor_id);
15612 __tmp.put_u8(self.quality);
15613 if matches!(version, MavlinkVersion::V2) {
15614 let len = __tmp.len();
15615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15616 } else {
15617 __tmp.len()
15618 }
15619 }
15620}
15621#[doc = "id: 92"]
15622#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15623#[derive(Debug, Clone, PartialEq)]
15624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15626pub struct HIL_RC_INPUTS_RAW_DATA {
15627 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15628 pub time_usec: u64,
15629 #[doc = "RC channel 1 value"]
15630 pub chan1_raw: u16,
15631 #[doc = "RC channel 2 value"]
15632 pub chan2_raw: u16,
15633 #[doc = "RC channel 3 value"]
15634 pub chan3_raw: u16,
15635 #[doc = "RC channel 4 value"]
15636 pub chan4_raw: u16,
15637 #[doc = "RC channel 5 value"]
15638 pub chan5_raw: u16,
15639 #[doc = "RC channel 6 value"]
15640 pub chan6_raw: u16,
15641 #[doc = "RC channel 7 value"]
15642 pub chan7_raw: u16,
15643 #[doc = "RC channel 8 value"]
15644 pub chan8_raw: u16,
15645 #[doc = "RC channel 9 value"]
15646 pub chan9_raw: u16,
15647 #[doc = "RC channel 10 value"]
15648 pub chan10_raw: u16,
15649 #[doc = "RC channel 11 value"]
15650 pub chan11_raw: u16,
15651 #[doc = "RC channel 12 value"]
15652 pub chan12_raw: u16,
15653 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
15654 pub rssi: u8,
15655}
15656impl HIL_RC_INPUTS_RAW_DATA {
15657 pub const ENCODED_LEN: usize = 33usize;
15658 pub const DEFAULT: Self = Self {
15659 time_usec: 0_u64,
15660 chan1_raw: 0_u16,
15661 chan2_raw: 0_u16,
15662 chan3_raw: 0_u16,
15663 chan4_raw: 0_u16,
15664 chan5_raw: 0_u16,
15665 chan6_raw: 0_u16,
15666 chan7_raw: 0_u16,
15667 chan8_raw: 0_u16,
15668 chan9_raw: 0_u16,
15669 chan10_raw: 0_u16,
15670 chan11_raw: 0_u16,
15671 chan12_raw: 0_u16,
15672 rssi: 0_u8,
15673 };
15674 #[cfg(feature = "arbitrary")]
15675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15676 use arbitrary::{Arbitrary, Unstructured};
15677 let mut buf = [0u8; 1024];
15678 rng.fill_bytes(&mut buf);
15679 let mut unstructured = Unstructured::new(&buf);
15680 Self::arbitrary(&mut unstructured).unwrap_or_default()
15681 }
15682}
15683impl Default for HIL_RC_INPUTS_RAW_DATA {
15684 fn default() -> Self {
15685 Self::DEFAULT.clone()
15686 }
15687}
15688impl MessageData for HIL_RC_INPUTS_RAW_DATA {
15689 type Message = MavMessage;
15690 const ID: u32 = 92u32;
15691 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
15692 const EXTRA_CRC: u8 = 54u8;
15693 const ENCODED_LEN: usize = 33usize;
15694 fn deser(
15695 _version: MavlinkVersion,
15696 __input: &[u8],
15697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15698 let avail_len = __input.len();
15699 let mut payload_buf = [0; Self::ENCODED_LEN];
15700 let mut buf = if avail_len < Self::ENCODED_LEN {
15701 payload_buf[0..avail_len].copy_from_slice(__input);
15702 Bytes::new(&payload_buf)
15703 } else {
15704 Bytes::new(__input)
15705 };
15706 let mut __struct = Self::default();
15707 __struct.time_usec = buf.get_u64_le();
15708 __struct.chan1_raw = buf.get_u16_le();
15709 __struct.chan2_raw = buf.get_u16_le();
15710 __struct.chan3_raw = buf.get_u16_le();
15711 __struct.chan4_raw = buf.get_u16_le();
15712 __struct.chan5_raw = buf.get_u16_le();
15713 __struct.chan6_raw = buf.get_u16_le();
15714 __struct.chan7_raw = buf.get_u16_le();
15715 __struct.chan8_raw = buf.get_u16_le();
15716 __struct.chan9_raw = buf.get_u16_le();
15717 __struct.chan10_raw = buf.get_u16_le();
15718 __struct.chan11_raw = buf.get_u16_le();
15719 __struct.chan12_raw = buf.get_u16_le();
15720 __struct.rssi = buf.get_u8();
15721 Ok(__struct)
15722 }
15723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15724 let mut __tmp = BytesMut::new(bytes);
15725 #[allow(clippy::absurd_extreme_comparisons)]
15726 #[allow(unused_comparisons)]
15727 if __tmp.remaining() < Self::ENCODED_LEN {
15728 panic!(
15729 "buffer is too small (need {} bytes, but got {})",
15730 Self::ENCODED_LEN,
15731 __tmp.remaining(),
15732 )
15733 }
15734 __tmp.put_u64_le(self.time_usec);
15735 __tmp.put_u16_le(self.chan1_raw);
15736 __tmp.put_u16_le(self.chan2_raw);
15737 __tmp.put_u16_le(self.chan3_raw);
15738 __tmp.put_u16_le(self.chan4_raw);
15739 __tmp.put_u16_le(self.chan5_raw);
15740 __tmp.put_u16_le(self.chan6_raw);
15741 __tmp.put_u16_le(self.chan7_raw);
15742 __tmp.put_u16_le(self.chan8_raw);
15743 __tmp.put_u16_le(self.chan9_raw);
15744 __tmp.put_u16_le(self.chan10_raw);
15745 __tmp.put_u16_le(self.chan11_raw);
15746 __tmp.put_u16_le(self.chan12_raw);
15747 __tmp.put_u8(self.rssi);
15748 if matches!(version, MavlinkVersion::V2) {
15749 let len = __tmp.len();
15750 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15751 } else {
15752 __tmp.len()
15753 }
15754 }
15755}
15756#[doc = "id: 107"]
15757#[doc = "The IMU readings in SI units in NED body frame."]
15758#[derive(Debug, Clone, PartialEq)]
15759#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15761pub struct HIL_SENSOR_DATA {
15762 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15763 pub time_usec: u64,
15764 #[doc = "X acceleration"]
15765 pub xacc: f32,
15766 #[doc = "Y acceleration"]
15767 pub yacc: f32,
15768 #[doc = "Z acceleration"]
15769 pub zacc: f32,
15770 #[doc = "Angular speed around X axis in body frame"]
15771 pub xgyro: f32,
15772 #[doc = "Angular speed around Y axis in body frame"]
15773 pub ygyro: f32,
15774 #[doc = "Angular speed around Z axis in body frame"]
15775 pub zgyro: f32,
15776 #[doc = "X Magnetic field"]
15777 pub xmag: f32,
15778 #[doc = "Y Magnetic field"]
15779 pub ymag: f32,
15780 #[doc = "Z Magnetic field"]
15781 pub zmag: f32,
15782 #[doc = "Absolute pressure"]
15783 pub abs_pressure: f32,
15784 #[doc = "Differential pressure (airspeed)"]
15785 pub diff_pressure: f32,
15786 #[doc = "Altitude calculated from pressure"]
15787 pub pressure_alt: f32,
15788 #[doc = "Temperature"]
15789 pub temperature: f32,
15790 #[doc = "Bitmap for fields that have updated since last message"]
15791 pub fields_updated: HilSensorUpdatedFlags,
15792 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
15793 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15794 pub id: u8,
15795}
15796impl HIL_SENSOR_DATA {
15797 pub const ENCODED_LEN: usize = 65usize;
15798 pub const DEFAULT: Self = Self {
15799 time_usec: 0_u64,
15800 xacc: 0.0_f32,
15801 yacc: 0.0_f32,
15802 zacc: 0.0_f32,
15803 xgyro: 0.0_f32,
15804 ygyro: 0.0_f32,
15805 zgyro: 0.0_f32,
15806 xmag: 0.0_f32,
15807 ymag: 0.0_f32,
15808 zmag: 0.0_f32,
15809 abs_pressure: 0.0_f32,
15810 diff_pressure: 0.0_f32,
15811 pressure_alt: 0.0_f32,
15812 temperature: 0.0_f32,
15813 fields_updated: HilSensorUpdatedFlags::DEFAULT,
15814 id: 0_u8,
15815 };
15816 #[cfg(feature = "arbitrary")]
15817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15818 use arbitrary::{Arbitrary, Unstructured};
15819 let mut buf = [0u8; 1024];
15820 rng.fill_bytes(&mut buf);
15821 let mut unstructured = Unstructured::new(&buf);
15822 Self::arbitrary(&mut unstructured).unwrap_or_default()
15823 }
15824}
15825impl Default for HIL_SENSOR_DATA {
15826 fn default() -> Self {
15827 Self::DEFAULT.clone()
15828 }
15829}
15830impl MessageData for HIL_SENSOR_DATA {
15831 type Message = MavMessage;
15832 const ID: u32 = 107u32;
15833 const NAME: &'static str = "HIL_SENSOR";
15834 const EXTRA_CRC: u8 = 108u8;
15835 const ENCODED_LEN: usize = 65usize;
15836 fn deser(
15837 _version: MavlinkVersion,
15838 __input: &[u8],
15839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15840 let avail_len = __input.len();
15841 let mut payload_buf = [0; Self::ENCODED_LEN];
15842 let mut buf = if avail_len < Self::ENCODED_LEN {
15843 payload_buf[0..avail_len].copy_from_slice(__input);
15844 Bytes::new(&payload_buf)
15845 } else {
15846 Bytes::new(__input)
15847 };
15848 let mut __struct = Self::default();
15849 __struct.time_usec = buf.get_u64_le();
15850 __struct.xacc = buf.get_f32_le();
15851 __struct.yacc = buf.get_f32_le();
15852 __struct.zacc = buf.get_f32_le();
15853 __struct.xgyro = buf.get_f32_le();
15854 __struct.ygyro = buf.get_f32_le();
15855 __struct.zgyro = buf.get_f32_le();
15856 __struct.xmag = buf.get_f32_le();
15857 __struct.ymag = buf.get_f32_le();
15858 __struct.zmag = buf.get_f32_le();
15859 __struct.abs_pressure = buf.get_f32_le();
15860 __struct.diff_pressure = buf.get_f32_le();
15861 __struct.pressure_alt = buf.get_f32_le();
15862 __struct.temperature = buf.get_f32_le();
15863 let tmp = buf.get_u32_le();
15864 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
15865 tmp & HilSensorUpdatedFlags::all().bits(),
15866 )
15867 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15868 flag_type: "HilSensorUpdatedFlags",
15869 value: tmp as u32,
15870 })?;
15871 __struct.id = buf.get_u8();
15872 Ok(__struct)
15873 }
15874 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15875 let mut __tmp = BytesMut::new(bytes);
15876 #[allow(clippy::absurd_extreme_comparisons)]
15877 #[allow(unused_comparisons)]
15878 if __tmp.remaining() < Self::ENCODED_LEN {
15879 panic!(
15880 "buffer is too small (need {} bytes, but got {})",
15881 Self::ENCODED_LEN,
15882 __tmp.remaining(),
15883 )
15884 }
15885 __tmp.put_u64_le(self.time_usec);
15886 __tmp.put_f32_le(self.xacc);
15887 __tmp.put_f32_le(self.yacc);
15888 __tmp.put_f32_le(self.zacc);
15889 __tmp.put_f32_le(self.xgyro);
15890 __tmp.put_f32_le(self.ygyro);
15891 __tmp.put_f32_le(self.zgyro);
15892 __tmp.put_f32_le(self.xmag);
15893 __tmp.put_f32_le(self.ymag);
15894 __tmp.put_f32_le(self.zmag);
15895 __tmp.put_f32_le(self.abs_pressure);
15896 __tmp.put_f32_le(self.diff_pressure);
15897 __tmp.put_f32_le(self.pressure_alt);
15898 __tmp.put_f32_le(self.temperature);
15899 __tmp.put_u32_le(self.fields_updated.bits());
15900 __tmp.put_u8(self.id);
15901 if matches!(version, MavlinkVersion::V2) {
15902 let len = __tmp.len();
15903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15904 } else {
15905 __tmp.len()
15906 }
15907 }
15908}
15909#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
15910#[doc = "id: 90"]
15911#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
15912#[derive(Debug, Clone, PartialEq)]
15913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15915pub struct HIL_STATE_DATA {
15916 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15917 pub time_usec: u64,
15918 #[doc = "Roll angle"]
15919 pub roll: f32,
15920 #[doc = "Pitch angle"]
15921 pub pitch: f32,
15922 #[doc = "Yaw angle"]
15923 pub yaw: f32,
15924 #[doc = "Body frame roll / phi angular speed"]
15925 pub rollspeed: f32,
15926 #[doc = "Body frame pitch / theta angular speed"]
15927 pub pitchspeed: f32,
15928 #[doc = "Body frame yaw / psi angular speed"]
15929 pub yawspeed: f32,
15930 #[doc = "Latitude"]
15931 pub lat: i32,
15932 #[doc = "Longitude"]
15933 pub lon: i32,
15934 #[doc = "Altitude"]
15935 pub alt: i32,
15936 #[doc = "Ground X Speed (Latitude)"]
15937 pub vx: i16,
15938 #[doc = "Ground Y Speed (Longitude)"]
15939 pub vy: i16,
15940 #[doc = "Ground Z Speed (Altitude)"]
15941 pub vz: i16,
15942 #[doc = "X acceleration"]
15943 pub xacc: i16,
15944 #[doc = "Y acceleration"]
15945 pub yacc: i16,
15946 #[doc = "Z acceleration"]
15947 pub zacc: i16,
15948}
15949impl HIL_STATE_DATA {
15950 pub const ENCODED_LEN: usize = 56usize;
15951 pub const DEFAULT: Self = Self {
15952 time_usec: 0_u64,
15953 roll: 0.0_f32,
15954 pitch: 0.0_f32,
15955 yaw: 0.0_f32,
15956 rollspeed: 0.0_f32,
15957 pitchspeed: 0.0_f32,
15958 yawspeed: 0.0_f32,
15959 lat: 0_i32,
15960 lon: 0_i32,
15961 alt: 0_i32,
15962 vx: 0_i16,
15963 vy: 0_i16,
15964 vz: 0_i16,
15965 xacc: 0_i16,
15966 yacc: 0_i16,
15967 zacc: 0_i16,
15968 };
15969 #[cfg(feature = "arbitrary")]
15970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15971 use arbitrary::{Arbitrary, Unstructured};
15972 let mut buf = [0u8; 1024];
15973 rng.fill_bytes(&mut buf);
15974 let mut unstructured = Unstructured::new(&buf);
15975 Self::arbitrary(&mut unstructured).unwrap_or_default()
15976 }
15977}
15978impl Default for HIL_STATE_DATA {
15979 fn default() -> Self {
15980 Self::DEFAULT.clone()
15981 }
15982}
15983impl MessageData for HIL_STATE_DATA {
15984 type Message = MavMessage;
15985 const ID: u32 = 90u32;
15986 const NAME: &'static str = "HIL_STATE";
15987 const EXTRA_CRC: u8 = 183u8;
15988 const ENCODED_LEN: usize = 56usize;
15989 fn deser(
15990 _version: MavlinkVersion,
15991 __input: &[u8],
15992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15993 let avail_len = __input.len();
15994 let mut payload_buf = [0; Self::ENCODED_LEN];
15995 let mut buf = if avail_len < Self::ENCODED_LEN {
15996 payload_buf[0..avail_len].copy_from_slice(__input);
15997 Bytes::new(&payload_buf)
15998 } else {
15999 Bytes::new(__input)
16000 };
16001 let mut __struct = Self::default();
16002 __struct.time_usec = buf.get_u64_le();
16003 __struct.roll = buf.get_f32_le();
16004 __struct.pitch = buf.get_f32_le();
16005 __struct.yaw = buf.get_f32_le();
16006 __struct.rollspeed = buf.get_f32_le();
16007 __struct.pitchspeed = buf.get_f32_le();
16008 __struct.yawspeed = buf.get_f32_le();
16009 __struct.lat = buf.get_i32_le();
16010 __struct.lon = buf.get_i32_le();
16011 __struct.alt = buf.get_i32_le();
16012 __struct.vx = buf.get_i16_le();
16013 __struct.vy = buf.get_i16_le();
16014 __struct.vz = buf.get_i16_le();
16015 __struct.xacc = buf.get_i16_le();
16016 __struct.yacc = buf.get_i16_le();
16017 __struct.zacc = buf.get_i16_le();
16018 Ok(__struct)
16019 }
16020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16021 let mut __tmp = BytesMut::new(bytes);
16022 #[allow(clippy::absurd_extreme_comparisons)]
16023 #[allow(unused_comparisons)]
16024 if __tmp.remaining() < Self::ENCODED_LEN {
16025 panic!(
16026 "buffer is too small (need {} bytes, but got {})",
16027 Self::ENCODED_LEN,
16028 __tmp.remaining(),
16029 )
16030 }
16031 __tmp.put_u64_le(self.time_usec);
16032 __tmp.put_f32_le(self.roll);
16033 __tmp.put_f32_le(self.pitch);
16034 __tmp.put_f32_le(self.yaw);
16035 __tmp.put_f32_le(self.rollspeed);
16036 __tmp.put_f32_le(self.pitchspeed);
16037 __tmp.put_f32_le(self.yawspeed);
16038 __tmp.put_i32_le(self.lat);
16039 __tmp.put_i32_le(self.lon);
16040 __tmp.put_i32_le(self.alt);
16041 __tmp.put_i16_le(self.vx);
16042 __tmp.put_i16_le(self.vy);
16043 __tmp.put_i16_le(self.vz);
16044 __tmp.put_i16_le(self.xacc);
16045 __tmp.put_i16_le(self.yacc);
16046 __tmp.put_i16_le(self.zacc);
16047 if matches!(version, MavlinkVersion::V2) {
16048 let len = __tmp.len();
16049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16050 } else {
16051 __tmp.len()
16052 }
16053 }
16054}
16055#[doc = "id: 115"]
16056#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16057#[derive(Debug, Clone, PartialEq)]
16058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16060pub struct HIL_STATE_QUATERNION_DATA {
16061 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16062 pub time_usec: u64,
16063 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16064 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16065 pub attitude_quaternion: [f32; 4],
16066 #[doc = "Body frame roll / phi angular speed"]
16067 pub rollspeed: f32,
16068 #[doc = "Body frame pitch / theta angular speed"]
16069 pub pitchspeed: f32,
16070 #[doc = "Body frame yaw / psi angular speed"]
16071 pub yawspeed: f32,
16072 #[doc = "Latitude"]
16073 pub lat: i32,
16074 #[doc = "Longitude"]
16075 pub lon: i32,
16076 #[doc = "Altitude"]
16077 pub alt: i32,
16078 #[doc = "Ground X Speed (Latitude)"]
16079 pub vx: i16,
16080 #[doc = "Ground Y Speed (Longitude)"]
16081 pub vy: i16,
16082 #[doc = "Ground Z Speed (Altitude)"]
16083 pub vz: i16,
16084 #[doc = "Indicated airspeed"]
16085 pub ind_airspeed: u16,
16086 #[doc = "True airspeed"]
16087 pub true_airspeed: u16,
16088 #[doc = "X acceleration"]
16089 pub xacc: i16,
16090 #[doc = "Y acceleration"]
16091 pub yacc: i16,
16092 #[doc = "Z acceleration"]
16093 pub zacc: i16,
16094}
16095impl HIL_STATE_QUATERNION_DATA {
16096 pub const ENCODED_LEN: usize = 64usize;
16097 pub const DEFAULT: Self = Self {
16098 time_usec: 0_u64,
16099 attitude_quaternion: [0.0_f32; 4usize],
16100 rollspeed: 0.0_f32,
16101 pitchspeed: 0.0_f32,
16102 yawspeed: 0.0_f32,
16103 lat: 0_i32,
16104 lon: 0_i32,
16105 alt: 0_i32,
16106 vx: 0_i16,
16107 vy: 0_i16,
16108 vz: 0_i16,
16109 ind_airspeed: 0_u16,
16110 true_airspeed: 0_u16,
16111 xacc: 0_i16,
16112 yacc: 0_i16,
16113 zacc: 0_i16,
16114 };
16115 #[cfg(feature = "arbitrary")]
16116 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16117 use arbitrary::{Arbitrary, Unstructured};
16118 let mut buf = [0u8; 1024];
16119 rng.fill_bytes(&mut buf);
16120 let mut unstructured = Unstructured::new(&buf);
16121 Self::arbitrary(&mut unstructured).unwrap_or_default()
16122 }
16123}
16124impl Default for HIL_STATE_QUATERNION_DATA {
16125 fn default() -> Self {
16126 Self::DEFAULT.clone()
16127 }
16128}
16129impl MessageData for HIL_STATE_QUATERNION_DATA {
16130 type Message = MavMessage;
16131 const ID: u32 = 115u32;
16132 const NAME: &'static str = "HIL_STATE_QUATERNION";
16133 const EXTRA_CRC: u8 = 4u8;
16134 const ENCODED_LEN: usize = 64usize;
16135 fn deser(
16136 _version: MavlinkVersion,
16137 __input: &[u8],
16138 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16139 let avail_len = __input.len();
16140 let mut payload_buf = [0; Self::ENCODED_LEN];
16141 let mut buf = if avail_len < Self::ENCODED_LEN {
16142 payload_buf[0..avail_len].copy_from_slice(__input);
16143 Bytes::new(&payload_buf)
16144 } else {
16145 Bytes::new(__input)
16146 };
16147 let mut __struct = Self::default();
16148 __struct.time_usec = buf.get_u64_le();
16149 for v in &mut __struct.attitude_quaternion {
16150 let val = buf.get_f32_le();
16151 *v = val;
16152 }
16153 __struct.rollspeed = buf.get_f32_le();
16154 __struct.pitchspeed = buf.get_f32_le();
16155 __struct.yawspeed = buf.get_f32_le();
16156 __struct.lat = buf.get_i32_le();
16157 __struct.lon = buf.get_i32_le();
16158 __struct.alt = buf.get_i32_le();
16159 __struct.vx = buf.get_i16_le();
16160 __struct.vy = buf.get_i16_le();
16161 __struct.vz = buf.get_i16_le();
16162 __struct.ind_airspeed = buf.get_u16_le();
16163 __struct.true_airspeed = buf.get_u16_le();
16164 __struct.xacc = buf.get_i16_le();
16165 __struct.yacc = buf.get_i16_le();
16166 __struct.zacc = buf.get_i16_le();
16167 Ok(__struct)
16168 }
16169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16170 let mut __tmp = BytesMut::new(bytes);
16171 #[allow(clippy::absurd_extreme_comparisons)]
16172 #[allow(unused_comparisons)]
16173 if __tmp.remaining() < Self::ENCODED_LEN {
16174 panic!(
16175 "buffer is too small (need {} bytes, but got {})",
16176 Self::ENCODED_LEN,
16177 __tmp.remaining(),
16178 )
16179 }
16180 __tmp.put_u64_le(self.time_usec);
16181 for val in &self.attitude_quaternion {
16182 __tmp.put_f32_le(*val);
16183 }
16184 __tmp.put_f32_le(self.rollspeed);
16185 __tmp.put_f32_le(self.pitchspeed);
16186 __tmp.put_f32_le(self.yawspeed);
16187 __tmp.put_i32_le(self.lat);
16188 __tmp.put_i32_le(self.lon);
16189 __tmp.put_i32_le(self.alt);
16190 __tmp.put_i16_le(self.vx);
16191 __tmp.put_i16_le(self.vy);
16192 __tmp.put_i16_le(self.vz);
16193 __tmp.put_u16_le(self.ind_airspeed);
16194 __tmp.put_u16_le(self.true_airspeed);
16195 __tmp.put_i16_le(self.xacc);
16196 __tmp.put_i16_le(self.yacc);
16197 __tmp.put_i16_le(self.zacc);
16198 if matches!(version, MavlinkVersion::V2) {
16199 let len = __tmp.len();
16200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16201 } else {
16202 __tmp.len()
16203 }
16204 }
16205}
16206#[doc = "id: 242"]
16207#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16208#[derive(Debug, Clone, PartialEq)]
16209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16211pub struct HOME_POSITION_DATA {
16212 #[doc = "Latitude (WGS84)"]
16213 pub latitude: i32,
16214 #[doc = "Longitude (WGS84)"]
16215 pub longitude: i32,
16216 #[doc = "Altitude (MSL). Positive for up."]
16217 pub altitude: i32,
16218 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16219 pub x: f32,
16220 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16221 pub y: f32,
16222 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16223 pub z: f32,
16224 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16226 pub q: [f32; 4],
16227 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16228 pub approach_x: f32,
16229 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16230 pub approach_y: f32,
16231 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16232 pub approach_z: f32,
16233 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16235 pub time_usec: u64,
16236}
16237impl HOME_POSITION_DATA {
16238 pub const ENCODED_LEN: usize = 60usize;
16239 pub const DEFAULT: Self = Self {
16240 latitude: 0_i32,
16241 longitude: 0_i32,
16242 altitude: 0_i32,
16243 x: 0.0_f32,
16244 y: 0.0_f32,
16245 z: 0.0_f32,
16246 q: [0.0_f32; 4usize],
16247 approach_x: 0.0_f32,
16248 approach_y: 0.0_f32,
16249 approach_z: 0.0_f32,
16250 time_usec: 0_u64,
16251 };
16252 #[cfg(feature = "arbitrary")]
16253 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16254 use arbitrary::{Arbitrary, Unstructured};
16255 let mut buf = [0u8; 1024];
16256 rng.fill_bytes(&mut buf);
16257 let mut unstructured = Unstructured::new(&buf);
16258 Self::arbitrary(&mut unstructured).unwrap_or_default()
16259 }
16260}
16261impl Default for HOME_POSITION_DATA {
16262 fn default() -> Self {
16263 Self::DEFAULT.clone()
16264 }
16265}
16266impl MessageData for HOME_POSITION_DATA {
16267 type Message = MavMessage;
16268 const ID: u32 = 242u32;
16269 const NAME: &'static str = "HOME_POSITION";
16270 const EXTRA_CRC: u8 = 104u8;
16271 const ENCODED_LEN: usize = 60usize;
16272 fn deser(
16273 _version: MavlinkVersion,
16274 __input: &[u8],
16275 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16276 let avail_len = __input.len();
16277 let mut payload_buf = [0; Self::ENCODED_LEN];
16278 let mut buf = if avail_len < Self::ENCODED_LEN {
16279 payload_buf[0..avail_len].copy_from_slice(__input);
16280 Bytes::new(&payload_buf)
16281 } else {
16282 Bytes::new(__input)
16283 };
16284 let mut __struct = Self::default();
16285 __struct.latitude = buf.get_i32_le();
16286 __struct.longitude = buf.get_i32_le();
16287 __struct.altitude = buf.get_i32_le();
16288 __struct.x = buf.get_f32_le();
16289 __struct.y = buf.get_f32_le();
16290 __struct.z = buf.get_f32_le();
16291 for v in &mut __struct.q {
16292 let val = buf.get_f32_le();
16293 *v = val;
16294 }
16295 __struct.approach_x = buf.get_f32_le();
16296 __struct.approach_y = buf.get_f32_le();
16297 __struct.approach_z = buf.get_f32_le();
16298 __struct.time_usec = buf.get_u64_le();
16299 Ok(__struct)
16300 }
16301 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16302 let mut __tmp = BytesMut::new(bytes);
16303 #[allow(clippy::absurd_extreme_comparisons)]
16304 #[allow(unused_comparisons)]
16305 if __tmp.remaining() < Self::ENCODED_LEN {
16306 panic!(
16307 "buffer is too small (need {} bytes, but got {})",
16308 Self::ENCODED_LEN,
16309 __tmp.remaining(),
16310 )
16311 }
16312 __tmp.put_i32_le(self.latitude);
16313 __tmp.put_i32_le(self.longitude);
16314 __tmp.put_i32_le(self.altitude);
16315 __tmp.put_f32_le(self.x);
16316 __tmp.put_f32_le(self.y);
16317 __tmp.put_f32_le(self.z);
16318 for val in &self.q {
16319 __tmp.put_f32_le(*val);
16320 }
16321 __tmp.put_f32_le(self.approach_x);
16322 __tmp.put_f32_le(self.approach_y);
16323 __tmp.put_f32_le(self.approach_z);
16324 __tmp.put_u64_le(self.time_usec);
16325 if matches!(version, MavlinkVersion::V2) {
16326 let len = __tmp.len();
16327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16328 } else {
16329 __tmp.len()
16330 }
16331 }
16332}
16333#[doc = "id: 12920"]
16334#[doc = "Temperature and humidity from hygrometer."]
16335#[derive(Debug, Clone, PartialEq)]
16336#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16337#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16338pub struct HYGROMETER_SENSOR_DATA {
16339 #[doc = "Temperature"]
16340 pub temperature: i16,
16341 #[doc = "Humidity"]
16342 pub humidity: u16,
16343 #[doc = "Hygrometer ID"]
16344 pub id: u8,
16345}
16346impl HYGROMETER_SENSOR_DATA {
16347 pub const ENCODED_LEN: usize = 5usize;
16348 pub const DEFAULT: Self = Self {
16349 temperature: 0_i16,
16350 humidity: 0_u16,
16351 id: 0_u8,
16352 };
16353 #[cfg(feature = "arbitrary")]
16354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16355 use arbitrary::{Arbitrary, Unstructured};
16356 let mut buf = [0u8; 1024];
16357 rng.fill_bytes(&mut buf);
16358 let mut unstructured = Unstructured::new(&buf);
16359 Self::arbitrary(&mut unstructured).unwrap_or_default()
16360 }
16361}
16362impl Default for HYGROMETER_SENSOR_DATA {
16363 fn default() -> Self {
16364 Self::DEFAULT.clone()
16365 }
16366}
16367impl MessageData for HYGROMETER_SENSOR_DATA {
16368 type Message = MavMessage;
16369 const ID: u32 = 12920u32;
16370 const NAME: &'static str = "HYGROMETER_SENSOR";
16371 const EXTRA_CRC: u8 = 20u8;
16372 const ENCODED_LEN: usize = 5usize;
16373 fn deser(
16374 _version: MavlinkVersion,
16375 __input: &[u8],
16376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16377 let avail_len = __input.len();
16378 let mut payload_buf = [0; Self::ENCODED_LEN];
16379 let mut buf = if avail_len < Self::ENCODED_LEN {
16380 payload_buf[0..avail_len].copy_from_slice(__input);
16381 Bytes::new(&payload_buf)
16382 } else {
16383 Bytes::new(__input)
16384 };
16385 let mut __struct = Self::default();
16386 __struct.temperature = buf.get_i16_le();
16387 __struct.humidity = buf.get_u16_le();
16388 __struct.id = buf.get_u8();
16389 Ok(__struct)
16390 }
16391 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16392 let mut __tmp = BytesMut::new(bytes);
16393 #[allow(clippy::absurd_extreme_comparisons)]
16394 #[allow(unused_comparisons)]
16395 if __tmp.remaining() < Self::ENCODED_LEN {
16396 panic!(
16397 "buffer is too small (need {} bytes, but got {})",
16398 Self::ENCODED_LEN,
16399 __tmp.remaining(),
16400 )
16401 }
16402 __tmp.put_i16_le(self.temperature);
16403 __tmp.put_u16_le(self.humidity);
16404 __tmp.put_u8(self.id);
16405 if matches!(version, MavlinkVersion::V2) {
16406 let len = __tmp.len();
16407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16408 } else {
16409 __tmp.len()
16410 }
16411 }
16412}
16413#[doc = "id: 440"]
16414#[doc = "Illuminator status."]
16415#[derive(Debug, Clone, PartialEq)]
16416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16418pub struct ILLUMINATOR_STATUS_DATA {
16419 #[doc = "Time since the start-up of the illuminator in ms"]
16420 pub uptime_ms: u32,
16421 #[doc = "Errors"]
16422 pub error_status: IlluminatorErrorFlags,
16423 #[doc = "Illuminator brightness"]
16424 pub brightness: f32,
16425 #[doc = "Illuminator strobing period in seconds"]
16426 pub strobe_period: f32,
16427 #[doc = "Illuminator strobing duty cycle"]
16428 pub strobe_duty_cycle: f32,
16429 #[doc = "Temperature in Celsius"]
16430 pub temp_c: f32,
16431 #[doc = "Minimum strobing period in seconds"]
16432 pub min_strobe_period: f32,
16433 #[doc = "Maximum strobing period in seconds"]
16434 pub max_strobe_period: f32,
16435 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16436 pub enable: u8,
16437 #[doc = "Supported illuminator modes"]
16438 pub mode_bitmask: IlluminatorMode,
16439 #[doc = "Illuminator mode"]
16440 pub mode: IlluminatorMode,
16441}
16442impl ILLUMINATOR_STATUS_DATA {
16443 pub const ENCODED_LEN: usize = 35usize;
16444 pub const DEFAULT: Self = Self {
16445 uptime_ms: 0_u32,
16446 error_status: IlluminatorErrorFlags::DEFAULT,
16447 brightness: 0.0_f32,
16448 strobe_period: 0.0_f32,
16449 strobe_duty_cycle: 0.0_f32,
16450 temp_c: 0.0_f32,
16451 min_strobe_period: 0.0_f32,
16452 max_strobe_period: 0.0_f32,
16453 enable: 0_u8,
16454 mode_bitmask: IlluminatorMode::DEFAULT,
16455 mode: IlluminatorMode::DEFAULT,
16456 };
16457 #[cfg(feature = "arbitrary")]
16458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16459 use arbitrary::{Arbitrary, Unstructured};
16460 let mut buf = [0u8; 1024];
16461 rng.fill_bytes(&mut buf);
16462 let mut unstructured = Unstructured::new(&buf);
16463 Self::arbitrary(&mut unstructured).unwrap_or_default()
16464 }
16465}
16466impl Default for ILLUMINATOR_STATUS_DATA {
16467 fn default() -> Self {
16468 Self::DEFAULT.clone()
16469 }
16470}
16471impl MessageData for ILLUMINATOR_STATUS_DATA {
16472 type Message = MavMessage;
16473 const ID: u32 = 440u32;
16474 const NAME: &'static str = "ILLUMINATOR_STATUS";
16475 const EXTRA_CRC: u8 = 66u8;
16476 const ENCODED_LEN: usize = 35usize;
16477 fn deser(
16478 _version: MavlinkVersion,
16479 __input: &[u8],
16480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16481 let avail_len = __input.len();
16482 let mut payload_buf = [0; Self::ENCODED_LEN];
16483 let mut buf = if avail_len < Self::ENCODED_LEN {
16484 payload_buf[0..avail_len].copy_from_slice(__input);
16485 Bytes::new(&payload_buf)
16486 } else {
16487 Bytes::new(__input)
16488 };
16489 let mut __struct = Self::default();
16490 __struct.uptime_ms = buf.get_u32_le();
16491 let tmp = buf.get_u32_le();
16492 __struct.error_status = IlluminatorErrorFlags::from_bits(
16493 tmp & IlluminatorErrorFlags::all().bits(),
16494 )
16495 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16496 flag_type: "IlluminatorErrorFlags",
16497 value: tmp as u32,
16498 })?;
16499 __struct.brightness = buf.get_f32_le();
16500 __struct.strobe_period = buf.get_f32_le();
16501 __struct.strobe_duty_cycle = buf.get_f32_le();
16502 __struct.temp_c = buf.get_f32_le();
16503 __struct.min_strobe_period = buf.get_f32_le();
16504 __struct.max_strobe_period = buf.get_f32_le();
16505 __struct.enable = buf.get_u8();
16506 let tmp = buf.get_u8();
16507 __struct.mode_bitmask =
16508 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16509 enum_type: "IlluminatorMode",
16510 value: tmp as u32,
16511 })?;
16512 let tmp = buf.get_u8();
16513 __struct.mode =
16514 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16515 enum_type: "IlluminatorMode",
16516 value: tmp as u32,
16517 })?;
16518 Ok(__struct)
16519 }
16520 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16521 let mut __tmp = BytesMut::new(bytes);
16522 #[allow(clippy::absurd_extreme_comparisons)]
16523 #[allow(unused_comparisons)]
16524 if __tmp.remaining() < Self::ENCODED_LEN {
16525 panic!(
16526 "buffer is too small (need {} bytes, but got {})",
16527 Self::ENCODED_LEN,
16528 __tmp.remaining(),
16529 )
16530 }
16531 __tmp.put_u32_le(self.uptime_ms);
16532 __tmp.put_u32_le(self.error_status.bits());
16533 __tmp.put_f32_le(self.brightness);
16534 __tmp.put_f32_le(self.strobe_period);
16535 __tmp.put_f32_le(self.strobe_duty_cycle);
16536 __tmp.put_f32_le(self.temp_c);
16537 __tmp.put_f32_le(self.min_strobe_period);
16538 __tmp.put_f32_le(self.max_strobe_period);
16539 __tmp.put_u8(self.enable);
16540 __tmp.put_u8(self.mode_bitmask as u8);
16541 __tmp.put_u8(self.mode as u8);
16542 if matches!(version, MavlinkVersion::V2) {
16543 let len = __tmp.len();
16544 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16545 } else {
16546 __tmp.len()
16547 }
16548 }
16549}
16550#[doc = "id: 335"]
16551#[doc = "Status of the Iridium SBD link."]
16552#[derive(Debug, Clone, PartialEq)]
16553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16555pub struct ISBD_LINK_STATUS_DATA {
16556 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16557 pub timestamp: u64,
16558 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16559 pub last_heartbeat: u64,
16560 #[doc = "Number of failed SBD sessions."]
16561 pub failed_sessions: u16,
16562 #[doc = "Number of successful SBD sessions."]
16563 pub successful_sessions: u16,
16564 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16565 pub signal_quality: u8,
16566 #[doc = "1: Ring call pending, 0: No call pending."]
16567 pub ring_pending: u8,
16568 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16569 pub tx_session_pending: u8,
16570 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16571 pub rx_session_pending: u8,
16572}
16573impl ISBD_LINK_STATUS_DATA {
16574 pub const ENCODED_LEN: usize = 24usize;
16575 pub const DEFAULT: Self = Self {
16576 timestamp: 0_u64,
16577 last_heartbeat: 0_u64,
16578 failed_sessions: 0_u16,
16579 successful_sessions: 0_u16,
16580 signal_quality: 0_u8,
16581 ring_pending: 0_u8,
16582 tx_session_pending: 0_u8,
16583 rx_session_pending: 0_u8,
16584 };
16585 #[cfg(feature = "arbitrary")]
16586 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16587 use arbitrary::{Arbitrary, Unstructured};
16588 let mut buf = [0u8; 1024];
16589 rng.fill_bytes(&mut buf);
16590 let mut unstructured = Unstructured::new(&buf);
16591 Self::arbitrary(&mut unstructured).unwrap_or_default()
16592 }
16593}
16594impl Default for ISBD_LINK_STATUS_DATA {
16595 fn default() -> Self {
16596 Self::DEFAULT.clone()
16597 }
16598}
16599impl MessageData for ISBD_LINK_STATUS_DATA {
16600 type Message = MavMessage;
16601 const ID: u32 = 335u32;
16602 const NAME: &'static str = "ISBD_LINK_STATUS";
16603 const EXTRA_CRC: u8 = 225u8;
16604 const ENCODED_LEN: usize = 24usize;
16605 fn deser(
16606 _version: MavlinkVersion,
16607 __input: &[u8],
16608 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16609 let avail_len = __input.len();
16610 let mut payload_buf = [0; Self::ENCODED_LEN];
16611 let mut buf = if avail_len < Self::ENCODED_LEN {
16612 payload_buf[0..avail_len].copy_from_slice(__input);
16613 Bytes::new(&payload_buf)
16614 } else {
16615 Bytes::new(__input)
16616 };
16617 let mut __struct = Self::default();
16618 __struct.timestamp = buf.get_u64_le();
16619 __struct.last_heartbeat = buf.get_u64_le();
16620 __struct.failed_sessions = buf.get_u16_le();
16621 __struct.successful_sessions = buf.get_u16_le();
16622 __struct.signal_quality = buf.get_u8();
16623 __struct.ring_pending = buf.get_u8();
16624 __struct.tx_session_pending = buf.get_u8();
16625 __struct.rx_session_pending = buf.get_u8();
16626 Ok(__struct)
16627 }
16628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16629 let mut __tmp = BytesMut::new(bytes);
16630 #[allow(clippy::absurd_extreme_comparisons)]
16631 #[allow(unused_comparisons)]
16632 if __tmp.remaining() < Self::ENCODED_LEN {
16633 panic!(
16634 "buffer is too small (need {} bytes, but got {})",
16635 Self::ENCODED_LEN,
16636 __tmp.remaining(),
16637 )
16638 }
16639 __tmp.put_u64_le(self.timestamp);
16640 __tmp.put_u64_le(self.last_heartbeat);
16641 __tmp.put_u16_le(self.failed_sessions);
16642 __tmp.put_u16_le(self.successful_sessions);
16643 __tmp.put_u8(self.signal_quality);
16644 __tmp.put_u8(self.ring_pending);
16645 __tmp.put_u8(self.tx_session_pending);
16646 __tmp.put_u8(self.rx_session_pending);
16647 if matches!(version, MavlinkVersion::V2) {
16648 let len = __tmp.len();
16649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16650 } else {
16651 __tmp.len()
16652 }
16653 }
16654}
16655#[doc = "id: 149"]
16656#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
16657#[derive(Debug, Clone, PartialEq)]
16658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16660pub struct LANDING_TARGET_DATA {
16661 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16662 pub time_usec: u64,
16663 #[doc = "X-axis angular offset of the target from the center of the image"]
16664 pub angle_x: f32,
16665 #[doc = "Y-axis angular offset of the target from the center of the image"]
16666 pub angle_y: f32,
16667 #[doc = "Distance to the target from the vehicle"]
16668 pub distance: f32,
16669 #[doc = "Size of target along x-axis"]
16670 pub size_x: f32,
16671 #[doc = "Size of target along y-axis"]
16672 pub size_y: f32,
16673 #[doc = "The ID of the target if multiple targets are present"]
16674 pub target_num: u8,
16675 #[doc = "Coordinate frame used for following fields."]
16676 pub frame: MavFrame,
16677 #[doc = "X Position of the landing target in MAV_FRAME"]
16678 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16679 pub x: f32,
16680 #[doc = "Y Position of the landing target in MAV_FRAME"]
16681 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16682 pub y: f32,
16683 #[doc = "Z Position of the landing target in MAV_FRAME"]
16684 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16685 pub z: f32,
16686 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
16687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16689 pub q: [f32; 4],
16690 #[doc = "Type of landing target"]
16691 #[cfg_attr(feature = "serde", serde(default))]
16692 pub mavtype: LandingTargetType,
16693 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
16694 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16695 pub position_valid: u8,
16696}
16697impl LANDING_TARGET_DATA {
16698 pub const ENCODED_LEN: usize = 60usize;
16699 pub const DEFAULT: Self = Self {
16700 time_usec: 0_u64,
16701 angle_x: 0.0_f32,
16702 angle_y: 0.0_f32,
16703 distance: 0.0_f32,
16704 size_x: 0.0_f32,
16705 size_y: 0.0_f32,
16706 target_num: 0_u8,
16707 frame: MavFrame::DEFAULT,
16708 x: 0.0_f32,
16709 y: 0.0_f32,
16710 z: 0.0_f32,
16711 q: [0.0_f32; 4usize],
16712 mavtype: LandingTargetType::DEFAULT,
16713 position_valid: 0_u8,
16714 };
16715 #[cfg(feature = "arbitrary")]
16716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16717 use arbitrary::{Arbitrary, Unstructured};
16718 let mut buf = [0u8; 1024];
16719 rng.fill_bytes(&mut buf);
16720 let mut unstructured = Unstructured::new(&buf);
16721 Self::arbitrary(&mut unstructured).unwrap_or_default()
16722 }
16723}
16724impl Default for LANDING_TARGET_DATA {
16725 fn default() -> Self {
16726 Self::DEFAULT.clone()
16727 }
16728}
16729impl MessageData for LANDING_TARGET_DATA {
16730 type Message = MavMessage;
16731 const ID: u32 = 149u32;
16732 const NAME: &'static str = "LANDING_TARGET";
16733 const EXTRA_CRC: u8 = 200u8;
16734 const ENCODED_LEN: usize = 60usize;
16735 fn deser(
16736 _version: MavlinkVersion,
16737 __input: &[u8],
16738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16739 let avail_len = __input.len();
16740 let mut payload_buf = [0; Self::ENCODED_LEN];
16741 let mut buf = if avail_len < Self::ENCODED_LEN {
16742 payload_buf[0..avail_len].copy_from_slice(__input);
16743 Bytes::new(&payload_buf)
16744 } else {
16745 Bytes::new(__input)
16746 };
16747 let mut __struct = Self::default();
16748 __struct.time_usec = buf.get_u64_le();
16749 __struct.angle_x = buf.get_f32_le();
16750 __struct.angle_y = buf.get_f32_le();
16751 __struct.distance = buf.get_f32_le();
16752 __struct.size_x = buf.get_f32_le();
16753 __struct.size_y = buf.get_f32_le();
16754 __struct.target_num = buf.get_u8();
16755 let tmp = buf.get_u8();
16756 __struct.frame =
16757 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16758 enum_type: "MavFrame",
16759 value: tmp as u32,
16760 })?;
16761 __struct.x = buf.get_f32_le();
16762 __struct.y = buf.get_f32_le();
16763 __struct.z = buf.get_f32_le();
16764 for v in &mut __struct.q {
16765 let val = buf.get_f32_le();
16766 *v = val;
16767 }
16768 let tmp = buf.get_u8();
16769 __struct.mavtype =
16770 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16771 enum_type: "LandingTargetType",
16772 value: tmp as u32,
16773 })?;
16774 __struct.position_valid = buf.get_u8();
16775 Ok(__struct)
16776 }
16777 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16778 let mut __tmp = BytesMut::new(bytes);
16779 #[allow(clippy::absurd_extreme_comparisons)]
16780 #[allow(unused_comparisons)]
16781 if __tmp.remaining() < Self::ENCODED_LEN {
16782 panic!(
16783 "buffer is too small (need {} bytes, but got {})",
16784 Self::ENCODED_LEN,
16785 __tmp.remaining(),
16786 )
16787 }
16788 __tmp.put_u64_le(self.time_usec);
16789 __tmp.put_f32_le(self.angle_x);
16790 __tmp.put_f32_le(self.angle_y);
16791 __tmp.put_f32_le(self.distance);
16792 __tmp.put_f32_le(self.size_x);
16793 __tmp.put_f32_le(self.size_y);
16794 __tmp.put_u8(self.target_num);
16795 __tmp.put_u8(self.frame as u8);
16796 __tmp.put_f32_le(self.x);
16797 __tmp.put_f32_le(self.y);
16798 __tmp.put_f32_le(self.z);
16799 for val in &self.q {
16800 __tmp.put_f32_le(*val);
16801 }
16802 __tmp.put_u8(self.mavtype as u8);
16803 __tmp.put_u8(self.position_valid);
16804 if matches!(version, MavlinkVersion::V2) {
16805 let len = __tmp.len();
16806 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16807 } else {
16808 __tmp.len()
16809 }
16810 }
16811}
16812#[doc = "id: 8"]
16813#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
16814#[derive(Debug, Clone, PartialEq)]
16815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16817pub struct LINK_NODE_STATUS_DATA {
16818 #[doc = "Timestamp (time since system boot)."]
16819 pub timestamp: u64,
16820 #[doc = "Transmit rate"]
16821 pub tx_rate: u32,
16822 #[doc = "Receive rate"]
16823 pub rx_rate: u32,
16824 #[doc = "Messages sent"]
16825 pub messages_sent: u32,
16826 #[doc = "Messages received (estimated from counting seq)"]
16827 pub messages_received: u32,
16828 #[doc = "Messages lost (estimated from counting seq)"]
16829 pub messages_lost: u32,
16830 #[doc = "Number of bytes that could not be parsed correctly."]
16831 pub rx_parse_err: u16,
16832 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16833 pub tx_overflows: u16,
16834 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
16835 pub rx_overflows: u16,
16836 #[doc = "Remaining free transmit buffer space"]
16837 pub tx_buf: u8,
16838 #[doc = "Remaining free receive buffer space"]
16839 pub rx_buf: u8,
16840}
16841impl LINK_NODE_STATUS_DATA {
16842 pub const ENCODED_LEN: usize = 36usize;
16843 pub const DEFAULT: Self = Self {
16844 timestamp: 0_u64,
16845 tx_rate: 0_u32,
16846 rx_rate: 0_u32,
16847 messages_sent: 0_u32,
16848 messages_received: 0_u32,
16849 messages_lost: 0_u32,
16850 rx_parse_err: 0_u16,
16851 tx_overflows: 0_u16,
16852 rx_overflows: 0_u16,
16853 tx_buf: 0_u8,
16854 rx_buf: 0_u8,
16855 };
16856 #[cfg(feature = "arbitrary")]
16857 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16858 use arbitrary::{Arbitrary, Unstructured};
16859 let mut buf = [0u8; 1024];
16860 rng.fill_bytes(&mut buf);
16861 let mut unstructured = Unstructured::new(&buf);
16862 Self::arbitrary(&mut unstructured).unwrap_or_default()
16863 }
16864}
16865impl Default for LINK_NODE_STATUS_DATA {
16866 fn default() -> Self {
16867 Self::DEFAULT.clone()
16868 }
16869}
16870impl MessageData for LINK_NODE_STATUS_DATA {
16871 type Message = MavMessage;
16872 const ID: u32 = 8u32;
16873 const NAME: &'static str = "LINK_NODE_STATUS";
16874 const EXTRA_CRC: u8 = 117u8;
16875 const ENCODED_LEN: usize = 36usize;
16876 fn deser(
16877 _version: MavlinkVersion,
16878 __input: &[u8],
16879 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16880 let avail_len = __input.len();
16881 let mut payload_buf = [0; Self::ENCODED_LEN];
16882 let mut buf = if avail_len < Self::ENCODED_LEN {
16883 payload_buf[0..avail_len].copy_from_slice(__input);
16884 Bytes::new(&payload_buf)
16885 } else {
16886 Bytes::new(__input)
16887 };
16888 let mut __struct = Self::default();
16889 __struct.timestamp = buf.get_u64_le();
16890 __struct.tx_rate = buf.get_u32_le();
16891 __struct.rx_rate = buf.get_u32_le();
16892 __struct.messages_sent = buf.get_u32_le();
16893 __struct.messages_received = buf.get_u32_le();
16894 __struct.messages_lost = buf.get_u32_le();
16895 __struct.rx_parse_err = buf.get_u16_le();
16896 __struct.tx_overflows = buf.get_u16_le();
16897 __struct.rx_overflows = buf.get_u16_le();
16898 __struct.tx_buf = buf.get_u8();
16899 __struct.rx_buf = buf.get_u8();
16900 Ok(__struct)
16901 }
16902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16903 let mut __tmp = BytesMut::new(bytes);
16904 #[allow(clippy::absurd_extreme_comparisons)]
16905 #[allow(unused_comparisons)]
16906 if __tmp.remaining() < Self::ENCODED_LEN {
16907 panic!(
16908 "buffer is too small (need {} bytes, but got {})",
16909 Self::ENCODED_LEN,
16910 __tmp.remaining(),
16911 )
16912 }
16913 __tmp.put_u64_le(self.timestamp);
16914 __tmp.put_u32_le(self.tx_rate);
16915 __tmp.put_u32_le(self.rx_rate);
16916 __tmp.put_u32_le(self.messages_sent);
16917 __tmp.put_u32_le(self.messages_received);
16918 __tmp.put_u32_le(self.messages_lost);
16919 __tmp.put_u16_le(self.rx_parse_err);
16920 __tmp.put_u16_le(self.tx_overflows);
16921 __tmp.put_u16_le(self.rx_overflows);
16922 __tmp.put_u8(self.tx_buf);
16923 __tmp.put_u8(self.rx_buf);
16924 if matches!(version, MavlinkVersion::V2) {
16925 let len = __tmp.len();
16926 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16927 } else {
16928 __tmp.len()
16929 }
16930 }
16931}
16932#[doc = "id: 32"]
16933#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
16934#[derive(Debug, Clone, PartialEq)]
16935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16937pub struct LOCAL_POSITION_NED_DATA {
16938 #[doc = "Timestamp (time since system boot)."]
16939 pub time_boot_ms: u32,
16940 #[doc = "X Position"]
16941 pub x: f32,
16942 #[doc = "Y Position"]
16943 pub y: f32,
16944 #[doc = "Z Position"]
16945 pub z: f32,
16946 #[doc = "X Speed"]
16947 pub vx: f32,
16948 #[doc = "Y Speed"]
16949 pub vy: f32,
16950 #[doc = "Z Speed"]
16951 pub vz: f32,
16952}
16953impl LOCAL_POSITION_NED_DATA {
16954 pub const ENCODED_LEN: usize = 28usize;
16955 pub const DEFAULT: Self = Self {
16956 time_boot_ms: 0_u32,
16957 x: 0.0_f32,
16958 y: 0.0_f32,
16959 z: 0.0_f32,
16960 vx: 0.0_f32,
16961 vy: 0.0_f32,
16962 vz: 0.0_f32,
16963 };
16964 #[cfg(feature = "arbitrary")]
16965 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16966 use arbitrary::{Arbitrary, Unstructured};
16967 let mut buf = [0u8; 1024];
16968 rng.fill_bytes(&mut buf);
16969 let mut unstructured = Unstructured::new(&buf);
16970 Self::arbitrary(&mut unstructured).unwrap_or_default()
16971 }
16972}
16973impl Default for LOCAL_POSITION_NED_DATA {
16974 fn default() -> Self {
16975 Self::DEFAULT.clone()
16976 }
16977}
16978impl MessageData for LOCAL_POSITION_NED_DATA {
16979 type Message = MavMessage;
16980 const ID: u32 = 32u32;
16981 const NAME: &'static str = "LOCAL_POSITION_NED";
16982 const EXTRA_CRC: u8 = 185u8;
16983 const ENCODED_LEN: usize = 28usize;
16984 fn deser(
16985 _version: MavlinkVersion,
16986 __input: &[u8],
16987 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16988 let avail_len = __input.len();
16989 let mut payload_buf = [0; Self::ENCODED_LEN];
16990 let mut buf = if avail_len < Self::ENCODED_LEN {
16991 payload_buf[0..avail_len].copy_from_slice(__input);
16992 Bytes::new(&payload_buf)
16993 } else {
16994 Bytes::new(__input)
16995 };
16996 let mut __struct = Self::default();
16997 __struct.time_boot_ms = buf.get_u32_le();
16998 __struct.x = buf.get_f32_le();
16999 __struct.y = buf.get_f32_le();
17000 __struct.z = buf.get_f32_le();
17001 __struct.vx = buf.get_f32_le();
17002 __struct.vy = buf.get_f32_le();
17003 __struct.vz = buf.get_f32_le();
17004 Ok(__struct)
17005 }
17006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17007 let mut __tmp = BytesMut::new(bytes);
17008 #[allow(clippy::absurd_extreme_comparisons)]
17009 #[allow(unused_comparisons)]
17010 if __tmp.remaining() < Self::ENCODED_LEN {
17011 panic!(
17012 "buffer is too small (need {} bytes, but got {})",
17013 Self::ENCODED_LEN,
17014 __tmp.remaining(),
17015 )
17016 }
17017 __tmp.put_u32_le(self.time_boot_ms);
17018 __tmp.put_f32_le(self.x);
17019 __tmp.put_f32_le(self.y);
17020 __tmp.put_f32_le(self.z);
17021 __tmp.put_f32_le(self.vx);
17022 __tmp.put_f32_le(self.vy);
17023 __tmp.put_f32_le(self.vz);
17024 if matches!(version, MavlinkVersion::V2) {
17025 let len = __tmp.len();
17026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17027 } else {
17028 __tmp.len()
17029 }
17030 }
17031}
17032#[doc = "id: 64"]
17033#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17034#[derive(Debug, Clone, PartialEq)]
17035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17037pub struct LOCAL_POSITION_NED_COV_DATA {
17038 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17039 pub time_usec: u64,
17040 #[doc = "X Position"]
17041 pub x: f32,
17042 #[doc = "Y Position"]
17043 pub y: f32,
17044 #[doc = "Z Position"]
17045 pub z: f32,
17046 #[doc = "X Speed"]
17047 pub vx: f32,
17048 #[doc = "Y Speed"]
17049 pub vy: f32,
17050 #[doc = "Z Speed"]
17051 pub vz: f32,
17052 #[doc = "X Acceleration"]
17053 pub ax: f32,
17054 #[doc = "Y Acceleration"]
17055 pub ay: f32,
17056 #[doc = "Z Acceleration"]
17057 pub az: f32,
17058 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17060 pub covariance: [f32; 45],
17061 #[doc = "Class id of the estimator this estimate originated from."]
17062 pub estimator_type: MavEstimatorType,
17063}
17064impl LOCAL_POSITION_NED_COV_DATA {
17065 pub const ENCODED_LEN: usize = 225usize;
17066 pub const DEFAULT: Self = Self {
17067 time_usec: 0_u64,
17068 x: 0.0_f32,
17069 y: 0.0_f32,
17070 z: 0.0_f32,
17071 vx: 0.0_f32,
17072 vy: 0.0_f32,
17073 vz: 0.0_f32,
17074 ax: 0.0_f32,
17075 ay: 0.0_f32,
17076 az: 0.0_f32,
17077 covariance: [0.0_f32; 45usize],
17078 estimator_type: MavEstimatorType::DEFAULT,
17079 };
17080 #[cfg(feature = "arbitrary")]
17081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17082 use arbitrary::{Arbitrary, Unstructured};
17083 let mut buf = [0u8; 1024];
17084 rng.fill_bytes(&mut buf);
17085 let mut unstructured = Unstructured::new(&buf);
17086 Self::arbitrary(&mut unstructured).unwrap_or_default()
17087 }
17088}
17089impl Default for LOCAL_POSITION_NED_COV_DATA {
17090 fn default() -> Self {
17091 Self::DEFAULT.clone()
17092 }
17093}
17094impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17095 type Message = MavMessage;
17096 const ID: u32 = 64u32;
17097 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17098 const EXTRA_CRC: u8 = 191u8;
17099 const ENCODED_LEN: usize = 225usize;
17100 fn deser(
17101 _version: MavlinkVersion,
17102 __input: &[u8],
17103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17104 let avail_len = __input.len();
17105 let mut payload_buf = [0; Self::ENCODED_LEN];
17106 let mut buf = if avail_len < Self::ENCODED_LEN {
17107 payload_buf[0..avail_len].copy_from_slice(__input);
17108 Bytes::new(&payload_buf)
17109 } else {
17110 Bytes::new(__input)
17111 };
17112 let mut __struct = Self::default();
17113 __struct.time_usec = buf.get_u64_le();
17114 __struct.x = buf.get_f32_le();
17115 __struct.y = buf.get_f32_le();
17116 __struct.z = buf.get_f32_le();
17117 __struct.vx = buf.get_f32_le();
17118 __struct.vy = buf.get_f32_le();
17119 __struct.vz = buf.get_f32_le();
17120 __struct.ax = buf.get_f32_le();
17121 __struct.ay = buf.get_f32_le();
17122 __struct.az = buf.get_f32_le();
17123 for v in &mut __struct.covariance {
17124 let val = buf.get_f32_le();
17125 *v = val;
17126 }
17127 let tmp = buf.get_u8();
17128 __struct.estimator_type =
17129 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17130 enum_type: "MavEstimatorType",
17131 value: tmp as u32,
17132 })?;
17133 Ok(__struct)
17134 }
17135 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17136 let mut __tmp = BytesMut::new(bytes);
17137 #[allow(clippy::absurd_extreme_comparisons)]
17138 #[allow(unused_comparisons)]
17139 if __tmp.remaining() < Self::ENCODED_LEN {
17140 panic!(
17141 "buffer is too small (need {} bytes, but got {})",
17142 Self::ENCODED_LEN,
17143 __tmp.remaining(),
17144 )
17145 }
17146 __tmp.put_u64_le(self.time_usec);
17147 __tmp.put_f32_le(self.x);
17148 __tmp.put_f32_le(self.y);
17149 __tmp.put_f32_le(self.z);
17150 __tmp.put_f32_le(self.vx);
17151 __tmp.put_f32_le(self.vy);
17152 __tmp.put_f32_le(self.vz);
17153 __tmp.put_f32_le(self.ax);
17154 __tmp.put_f32_le(self.ay);
17155 __tmp.put_f32_le(self.az);
17156 for val in &self.covariance {
17157 __tmp.put_f32_le(*val);
17158 }
17159 __tmp.put_u8(self.estimator_type as u8);
17160 if matches!(version, MavlinkVersion::V2) {
17161 let len = __tmp.len();
17162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17163 } else {
17164 __tmp.len()
17165 }
17166 }
17167}
17168#[doc = "id: 89"]
17169#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17170#[derive(Debug, Clone, PartialEq)]
17171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17173pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17174 #[doc = "Timestamp (time since system boot)."]
17175 pub time_boot_ms: u32,
17176 #[doc = "X Position"]
17177 pub x: f32,
17178 #[doc = "Y Position"]
17179 pub y: f32,
17180 #[doc = "Z Position"]
17181 pub z: f32,
17182 #[doc = "Roll"]
17183 pub roll: f32,
17184 #[doc = "Pitch"]
17185 pub pitch: f32,
17186 #[doc = "Yaw"]
17187 pub yaw: f32,
17188}
17189impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17190 pub const ENCODED_LEN: usize = 28usize;
17191 pub const DEFAULT: Self = Self {
17192 time_boot_ms: 0_u32,
17193 x: 0.0_f32,
17194 y: 0.0_f32,
17195 z: 0.0_f32,
17196 roll: 0.0_f32,
17197 pitch: 0.0_f32,
17198 yaw: 0.0_f32,
17199 };
17200 #[cfg(feature = "arbitrary")]
17201 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17202 use arbitrary::{Arbitrary, Unstructured};
17203 let mut buf = [0u8; 1024];
17204 rng.fill_bytes(&mut buf);
17205 let mut unstructured = Unstructured::new(&buf);
17206 Self::arbitrary(&mut unstructured).unwrap_or_default()
17207 }
17208}
17209impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17210 fn default() -> Self {
17211 Self::DEFAULT.clone()
17212 }
17213}
17214impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17215 type Message = MavMessage;
17216 const ID: u32 = 89u32;
17217 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17218 const EXTRA_CRC: u8 = 231u8;
17219 const ENCODED_LEN: usize = 28usize;
17220 fn deser(
17221 _version: MavlinkVersion,
17222 __input: &[u8],
17223 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17224 let avail_len = __input.len();
17225 let mut payload_buf = [0; Self::ENCODED_LEN];
17226 let mut buf = if avail_len < Self::ENCODED_LEN {
17227 payload_buf[0..avail_len].copy_from_slice(__input);
17228 Bytes::new(&payload_buf)
17229 } else {
17230 Bytes::new(__input)
17231 };
17232 let mut __struct = Self::default();
17233 __struct.time_boot_ms = buf.get_u32_le();
17234 __struct.x = buf.get_f32_le();
17235 __struct.y = buf.get_f32_le();
17236 __struct.z = buf.get_f32_le();
17237 __struct.roll = buf.get_f32_le();
17238 __struct.pitch = buf.get_f32_le();
17239 __struct.yaw = buf.get_f32_le();
17240 Ok(__struct)
17241 }
17242 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17243 let mut __tmp = BytesMut::new(bytes);
17244 #[allow(clippy::absurd_extreme_comparisons)]
17245 #[allow(unused_comparisons)]
17246 if __tmp.remaining() < Self::ENCODED_LEN {
17247 panic!(
17248 "buffer is too small (need {} bytes, but got {})",
17249 Self::ENCODED_LEN,
17250 __tmp.remaining(),
17251 )
17252 }
17253 __tmp.put_u32_le(self.time_boot_ms);
17254 __tmp.put_f32_le(self.x);
17255 __tmp.put_f32_le(self.y);
17256 __tmp.put_f32_le(self.z);
17257 __tmp.put_f32_le(self.roll);
17258 __tmp.put_f32_le(self.pitch);
17259 __tmp.put_f32_le(self.yaw);
17260 if matches!(version, MavlinkVersion::V2) {
17261 let len = __tmp.len();
17262 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17263 } else {
17264 __tmp.len()
17265 }
17266 }
17267}
17268#[doc = "id: 268"]
17269#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17270#[derive(Debug, Clone, PartialEq)]
17271#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17273pub struct LOGGING_ACK_DATA {
17274 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17275 pub sequence: u16,
17276 #[doc = "system ID of the target"]
17277 pub target_system: u8,
17278 #[doc = "component ID of the target"]
17279 pub target_component: u8,
17280}
17281impl LOGGING_ACK_DATA {
17282 pub const ENCODED_LEN: usize = 4usize;
17283 pub const DEFAULT: Self = Self {
17284 sequence: 0_u16,
17285 target_system: 0_u8,
17286 target_component: 0_u8,
17287 };
17288 #[cfg(feature = "arbitrary")]
17289 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17290 use arbitrary::{Arbitrary, Unstructured};
17291 let mut buf = [0u8; 1024];
17292 rng.fill_bytes(&mut buf);
17293 let mut unstructured = Unstructured::new(&buf);
17294 Self::arbitrary(&mut unstructured).unwrap_or_default()
17295 }
17296}
17297impl Default for LOGGING_ACK_DATA {
17298 fn default() -> Self {
17299 Self::DEFAULT.clone()
17300 }
17301}
17302impl MessageData for LOGGING_ACK_DATA {
17303 type Message = MavMessage;
17304 const ID: u32 = 268u32;
17305 const NAME: &'static str = "LOGGING_ACK";
17306 const EXTRA_CRC: u8 = 14u8;
17307 const ENCODED_LEN: usize = 4usize;
17308 fn deser(
17309 _version: MavlinkVersion,
17310 __input: &[u8],
17311 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17312 let avail_len = __input.len();
17313 let mut payload_buf = [0; Self::ENCODED_LEN];
17314 let mut buf = if avail_len < Self::ENCODED_LEN {
17315 payload_buf[0..avail_len].copy_from_slice(__input);
17316 Bytes::new(&payload_buf)
17317 } else {
17318 Bytes::new(__input)
17319 };
17320 let mut __struct = Self::default();
17321 __struct.sequence = buf.get_u16_le();
17322 __struct.target_system = buf.get_u8();
17323 __struct.target_component = buf.get_u8();
17324 Ok(__struct)
17325 }
17326 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17327 let mut __tmp = BytesMut::new(bytes);
17328 #[allow(clippy::absurd_extreme_comparisons)]
17329 #[allow(unused_comparisons)]
17330 if __tmp.remaining() < Self::ENCODED_LEN {
17331 panic!(
17332 "buffer is too small (need {} bytes, but got {})",
17333 Self::ENCODED_LEN,
17334 __tmp.remaining(),
17335 )
17336 }
17337 __tmp.put_u16_le(self.sequence);
17338 __tmp.put_u8(self.target_system);
17339 __tmp.put_u8(self.target_component);
17340 if matches!(version, MavlinkVersion::V2) {
17341 let len = __tmp.len();
17342 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17343 } else {
17344 __tmp.len()
17345 }
17346 }
17347}
17348#[doc = "id: 266"]
17349#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17350#[derive(Debug, Clone, PartialEq)]
17351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17352#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17353pub struct LOGGING_DATA_DATA {
17354 #[doc = "sequence number (can wrap)"]
17355 pub sequence: u16,
17356 #[doc = "system ID of the target"]
17357 pub target_system: u8,
17358 #[doc = "component ID of the target"]
17359 pub target_component: u8,
17360 #[doc = "data length"]
17361 pub length: u8,
17362 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17363 pub first_message_offset: u8,
17364 #[doc = "logged data"]
17365 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17366 pub data: [u8; 249],
17367}
17368impl LOGGING_DATA_DATA {
17369 pub const ENCODED_LEN: usize = 255usize;
17370 pub const DEFAULT: Self = Self {
17371 sequence: 0_u16,
17372 target_system: 0_u8,
17373 target_component: 0_u8,
17374 length: 0_u8,
17375 first_message_offset: 0_u8,
17376 data: [0_u8; 249usize],
17377 };
17378 #[cfg(feature = "arbitrary")]
17379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17380 use arbitrary::{Arbitrary, Unstructured};
17381 let mut buf = [0u8; 1024];
17382 rng.fill_bytes(&mut buf);
17383 let mut unstructured = Unstructured::new(&buf);
17384 Self::arbitrary(&mut unstructured).unwrap_or_default()
17385 }
17386}
17387impl Default for LOGGING_DATA_DATA {
17388 fn default() -> Self {
17389 Self::DEFAULT.clone()
17390 }
17391}
17392impl MessageData for LOGGING_DATA_DATA {
17393 type Message = MavMessage;
17394 const ID: u32 = 266u32;
17395 const NAME: &'static str = "LOGGING_DATA";
17396 const EXTRA_CRC: u8 = 193u8;
17397 const ENCODED_LEN: usize = 255usize;
17398 fn deser(
17399 _version: MavlinkVersion,
17400 __input: &[u8],
17401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17402 let avail_len = __input.len();
17403 let mut payload_buf = [0; Self::ENCODED_LEN];
17404 let mut buf = if avail_len < Self::ENCODED_LEN {
17405 payload_buf[0..avail_len].copy_from_slice(__input);
17406 Bytes::new(&payload_buf)
17407 } else {
17408 Bytes::new(__input)
17409 };
17410 let mut __struct = Self::default();
17411 __struct.sequence = buf.get_u16_le();
17412 __struct.target_system = buf.get_u8();
17413 __struct.target_component = buf.get_u8();
17414 __struct.length = buf.get_u8();
17415 __struct.first_message_offset = buf.get_u8();
17416 for v in &mut __struct.data {
17417 let val = buf.get_u8();
17418 *v = val;
17419 }
17420 Ok(__struct)
17421 }
17422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17423 let mut __tmp = BytesMut::new(bytes);
17424 #[allow(clippy::absurd_extreme_comparisons)]
17425 #[allow(unused_comparisons)]
17426 if __tmp.remaining() < Self::ENCODED_LEN {
17427 panic!(
17428 "buffer is too small (need {} bytes, but got {})",
17429 Self::ENCODED_LEN,
17430 __tmp.remaining(),
17431 )
17432 }
17433 __tmp.put_u16_le(self.sequence);
17434 __tmp.put_u8(self.target_system);
17435 __tmp.put_u8(self.target_component);
17436 __tmp.put_u8(self.length);
17437 __tmp.put_u8(self.first_message_offset);
17438 for val in &self.data {
17439 __tmp.put_u8(*val);
17440 }
17441 if matches!(version, MavlinkVersion::V2) {
17442 let len = __tmp.len();
17443 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17444 } else {
17445 __tmp.len()
17446 }
17447 }
17448}
17449#[doc = "id: 267"]
17450#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17451#[derive(Debug, Clone, PartialEq)]
17452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17454pub struct LOGGING_DATA_ACKED_DATA {
17455 #[doc = "sequence number (can wrap)"]
17456 pub sequence: u16,
17457 #[doc = "system ID of the target"]
17458 pub target_system: u8,
17459 #[doc = "component ID of the target"]
17460 pub target_component: u8,
17461 #[doc = "data length"]
17462 pub length: u8,
17463 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17464 pub first_message_offset: u8,
17465 #[doc = "logged data"]
17466 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17467 pub data: [u8; 249],
17468}
17469impl LOGGING_DATA_ACKED_DATA {
17470 pub const ENCODED_LEN: usize = 255usize;
17471 pub const DEFAULT: Self = Self {
17472 sequence: 0_u16,
17473 target_system: 0_u8,
17474 target_component: 0_u8,
17475 length: 0_u8,
17476 first_message_offset: 0_u8,
17477 data: [0_u8; 249usize],
17478 };
17479 #[cfg(feature = "arbitrary")]
17480 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17481 use arbitrary::{Arbitrary, Unstructured};
17482 let mut buf = [0u8; 1024];
17483 rng.fill_bytes(&mut buf);
17484 let mut unstructured = Unstructured::new(&buf);
17485 Self::arbitrary(&mut unstructured).unwrap_or_default()
17486 }
17487}
17488impl Default for LOGGING_DATA_ACKED_DATA {
17489 fn default() -> Self {
17490 Self::DEFAULT.clone()
17491 }
17492}
17493impl MessageData for LOGGING_DATA_ACKED_DATA {
17494 type Message = MavMessage;
17495 const ID: u32 = 267u32;
17496 const NAME: &'static str = "LOGGING_DATA_ACKED";
17497 const EXTRA_CRC: u8 = 35u8;
17498 const ENCODED_LEN: usize = 255usize;
17499 fn deser(
17500 _version: MavlinkVersion,
17501 __input: &[u8],
17502 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17503 let avail_len = __input.len();
17504 let mut payload_buf = [0; Self::ENCODED_LEN];
17505 let mut buf = if avail_len < Self::ENCODED_LEN {
17506 payload_buf[0..avail_len].copy_from_slice(__input);
17507 Bytes::new(&payload_buf)
17508 } else {
17509 Bytes::new(__input)
17510 };
17511 let mut __struct = Self::default();
17512 __struct.sequence = buf.get_u16_le();
17513 __struct.target_system = buf.get_u8();
17514 __struct.target_component = buf.get_u8();
17515 __struct.length = buf.get_u8();
17516 __struct.first_message_offset = buf.get_u8();
17517 for v in &mut __struct.data {
17518 let val = buf.get_u8();
17519 *v = val;
17520 }
17521 Ok(__struct)
17522 }
17523 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17524 let mut __tmp = BytesMut::new(bytes);
17525 #[allow(clippy::absurd_extreme_comparisons)]
17526 #[allow(unused_comparisons)]
17527 if __tmp.remaining() < Self::ENCODED_LEN {
17528 panic!(
17529 "buffer is too small (need {} bytes, but got {})",
17530 Self::ENCODED_LEN,
17531 __tmp.remaining(),
17532 )
17533 }
17534 __tmp.put_u16_le(self.sequence);
17535 __tmp.put_u8(self.target_system);
17536 __tmp.put_u8(self.target_component);
17537 __tmp.put_u8(self.length);
17538 __tmp.put_u8(self.first_message_offset);
17539 for val in &self.data {
17540 __tmp.put_u8(*val);
17541 }
17542 if matches!(version, MavlinkVersion::V2) {
17543 let len = __tmp.len();
17544 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17545 } else {
17546 __tmp.len()
17547 }
17548 }
17549}
17550#[doc = "id: 120"]
17551#[doc = "Reply to LOG_REQUEST_DATA."]
17552#[derive(Debug, Clone, PartialEq)]
17553#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17554#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17555pub struct LOG_DATA_DATA {
17556 #[doc = "Offset into the log"]
17557 pub ofs: u32,
17558 #[doc = "Log id (from LOG_ENTRY reply)"]
17559 pub id: u16,
17560 #[doc = "Number of bytes (zero for end of log)"]
17561 pub count: u8,
17562 #[doc = "log data"]
17563 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17564 pub data: [u8; 90],
17565}
17566impl LOG_DATA_DATA {
17567 pub const ENCODED_LEN: usize = 97usize;
17568 pub const DEFAULT: Self = Self {
17569 ofs: 0_u32,
17570 id: 0_u16,
17571 count: 0_u8,
17572 data: [0_u8; 90usize],
17573 };
17574 #[cfg(feature = "arbitrary")]
17575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17576 use arbitrary::{Arbitrary, Unstructured};
17577 let mut buf = [0u8; 1024];
17578 rng.fill_bytes(&mut buf);
17579 let mut unstructured = Unstructured::new(&buf);
17580 Self::arbitrary(&mut unstructured).unwrap_or_default()
17581 }
17582}
17583impl Default for LOG_DATA_DATA {
17584 fn default() -> Self {
17585 Self::DEFAULT.clone()
17586 }
17587}
17588impl MessageData for LOG_DATA_DATA {
17589 type Message = MavMessage;
17590 const ID: u32 = 120u32;
17591 const NAME: &'static str = "LOG_DATA";
17592 const EXTRA_CRC: u8 = 134u8;
17593 const ENCODED_LEN: usize = 97usize;
17594 fn deser(
17595 _version: MavlinkVersion,
17596 __input: &[u8],
17597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17598 let avail_len = __input.len();
17599 let mut payload_buf = [0; Self::ENCODED_LEN];
17600 let mut buf = if avail_len < Self::ENCODED_LEN {
17601 payload_buf[0..avail_len].copy_from_slice(__input);
17602 Bytes::new(&payload_buf)
17603 } else {
17604 Bytes::new(__input)
17605 };
17606 let mut __struct = Self::default();
17607 __struct.ofs = buf.get_u32_le();
17608 __struct.id = buf.get_u16_le();
17609 __struct.count = buf.get_u8();
17610 for v in &mut __struct.data {
17611 let val = buf.get_u8();
17612 *v = val;
17613 }
17614 Ok(__struct)
17615 }
17616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17617 let mut __tmp = BytesMut::new(bytes);
17618 #[allow(clippy::absurd_extreme_comparisons)]
17619 #[allow(unused_comparisons)]
17620 if __tmp.remaining() < Self::ENCODED_LEN {
17621 panic!(
17622 "buffer is too small (need {} bytes, but got {})",
17623 Self::ENCODED_LEN,
17624 __tmp.remaining(),
17625 )
17626 }
17627 __tmp.put_u32_le(self.ofs);
17628 __tmp.put_u16_le(self.id);
17629 __tmp.put_u8(self.count);
17630 for val in &self.data {
17631 __tmp.put_u8(*val);
17632 }
17633 if matches!(version, MavlinkVersion::V2) {
17634 let len = __tmp.len();
17635 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17636 } else {
17637 __tmp.len()
17638 }
17639 }
17640}
17641#[doc = "id: 118"]
17642#[doc = "Reply to LOG_REQUEST_LIST."]
17643#[derive(Debug, Clone, PartialEq)]
17644#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17646pub struct LOG_ENTRY_DATA {
17647 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
17648 pub time_utc: u32,
17649 #[doc = "Size of the log (may be approximate)"]
17650 pub size: u32,
17651 #[doc = "Log id"]
17652 pub id: u16,
17653 #[doc = "Total number of logs"]
17654 pub num_logs: u16,
17655 #[doc = "High log number"]
17656 pub last_log_num: u16,
17657}
17658impl LOG_ENTRY_DATA {
17659 pub const ENCODED_LEN: usize = 14usize;
17660 pub const DEFAULT: Self = Self {
17661 time_utc: 0_u32,
17662 size: 0_u32,
17663 id: 0_u16,
17664 num_logs: 0_u16,
17665 last_log_num: 0_u16,
17666 };
17667 #[cfg(feature = "arbitrary")]
17668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17669 use arbitrary::{Arbitrary, Unstructured};
17670 let mut buf = [0u8; 1024];
17671 rng.fill_bytes(&mut buf);
17672 let mut unstructured = Unstructured::new(&buf);
17673 Self::arbitrary(&mut unstructured).unwrap_or_default()
17674 }
17675}
17676impl Default for LOG_ENTRY_DATA {
17677 fn default() -> Self {
17678 Self::DEFAULT.clone()
17679 }
17680}
17681impl MessageData for LOG_ENTRY_DATA {
17682 type Message = MavMessage;
17683 const ID: u32 = 118u32;
17684 const NAME: &'static str = "LOG_ENTRY";
17685 const EXTRA_CRC: u8 = 56u8;
17686 const ENCODED_LEN: usize = 14usize;
17687 fn deser(
17688 _version: MavlinkVersion,
17689 __input: &[u8],
17690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17691 let avail_len = __input.len();
17692 let mut payload_buf = [0; Self::ENCODED_LEN];
17693 let mut buf = if avail_len < Self::ENCODED_LEN {
17694 payload_buf[0..avail_len].copy_from_slice(__input);
17695 Bytes::new(&payload_buf)
17696 } else {
17697 Bytes::new(__input)
17698 };
17699 let mut __struct = Self::default();
17700 __struct.time_utc = buf.get_u32_le();
17701 __struct.size = buf.get_u32_le();
17702 __struct.id = buf.get_u16_le();
17703 __struct.num_logs = buf.get_u16_le();
17704 __struct.last_log_num = buf.get_u16_le();
17705 Ok(__struct)
17706 }
17707 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17708 let mut __tmp = BytesMut::new(bytes);
17709 #[allow(clippy::absurd_extreme_comparisons)]
17710 #[allow(unused_comparisons)]
17711 if __tmp.remaining() < Self::ENCODED_LEN {
17712 panic!(
17713 "buffer is too small (need {} bytes, but got {})",
17714 Self::ENCODED_LEN,
17715 __tmp.remaining(),
17716 )
17717 }
17718 __tmp.put_u32_le(self.time_utc);
17719 __tmp.put_u32_le(self.size);
17720 __tmp.put_u16_le(self.id);
17721 __tmp.put_u16_le(self.num_logs);
17722 __tmp.put_u16_le(self.last_log_num);
17723 if matches!(version, MavlinkVersion::V2) {
17724 let len = __tmp.len();
17725 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17726 } else {
17727 __tmp.len()
17728 }
17729 }
17730}
17731#[doc = "id: 121"]
17732#[doc = "Erase all logs."]
17733#[derive(Debug, Clone, PartialEq)]
17734#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17735#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17736pub struct LOG_ERASE_DATA {
17737 #[doc = "System ID"]
17738 pub target_system: u8,
17739 #[doc = "Component ID"]
17740 pub target_component: u8,
17741}
17742impl LOG_ERASE_DATA {
17743 pub const ENCODED_LEN: usize = 2usize;
17744 pub const DEFAULT: Self = Self {
17745 target_system: 0_u8,
17746 target_component: 0_u8,
17747 };
17748 #[cfg(feature = "arbitrary")]
17749 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17750 use arbitrary::{Arbitrary, Unstructured};
17751 let mut buf = [0u8; 1024];
17752 rng.fill_bytes(&mut buf);
17753 let mut unstructured = Unstructured::new(&buf);
17754 Self::arbitrary(&mut unstructured).unwrap_or_default()
17755 }
17756}
17757impl Default for LOG_ERASE_DATA {
17758 fn default() -> Self {
17759 Self::DEFAULT.clone()
17760 }
17761}
17762impl MessageData for LOG_ERASE_DATA {
17763 type Message = MavMessage;
17764 const ID: u32 = 121u32;
17765 const NAME: &'static str = "LOG_ERASE";
17766 const EXTRA_CRC: u8 = 237u8;
17767 const ENCODED_LEN: usize = 2usize;
17768 fn deser(
17769 _version: MavlinkVersion,
17770 __input: &[u8],
17771 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17772 let avail_len = __input.len();
17773 let mut payload_buf = [0; Self::ENCODED_LEN];
17774 let mut buf = if avail_len < Self::ENCODED_LEN {
17775 payload_buf[0..avail_len].copy_from_slice(__input);
17776 Bytes::new(&payload_buf)
17777 } else {
17778 Bytes::new(__input)
17779 };
17780 let mut __struct = Self::default();
17781 __struct.target_system = buf.get_u8();
17782 __struct.target_component = buf.get_u8();
17783 Ok(__struct)
17784 }
17785 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17786 let mut __tmp = BytesMut::new(bytes);
17787 #[allow(clippy::absurd_extreme_comparisons)]
17788 #[allow(unused_comparisons)]
17789 if __tmp.remaining() < Self::ENCODED_LEN {
17790 panic!(
17791 "buffer is too small (need {} bytes, but got {})",
17792 Self::ENCODED_LEN,
17793 __tmp.remaining(),
17794 )
17795 }
17796 __tmp.put_u8(self.target_system);
17797 __tmp.put_u8(self.target_component);
17798 if matches!(version, MavlinkVersion::V2) {
17799 let len = __tmp.len();
17800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17801 } else {
17802 __tmp.len()
17803 }
17804 }
17805}
17806#[doc = "id: 119"]
17807#[doc = "Request a chunk of a log."]
17808#[derive(Debug, Clone, PartialEq)]
17809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17811pub struct LOG_REQUEST_DATA_DATA {
17812 #[doc = "Offset into the log"]
17813 pub ofs: u32,
17814 #[doc = "Number of bytes"]
17815 pub count: u32,
17816 #[doc = "Log id (from LOG_ENTRY reply)"]
17817 pub id: u16,
17818 #[doc = "System ID"]
17819 pub target_system: u8,
17820 #[doc = "Component ID"]
17821 pub target_component: u8,
17822}
17823impl LOG_REQUEST_DATA_DATA {
17824 pub const ENCODED_LEN: usize = 12usize;
17825 pub const DEFAULT: Self = Self {
17826 ofs: 0_u32,
17827 count: 0_u32,
17828 id: 0_u16,
17829 target_system: 0_u8,
17830 target_component: 0_u8,
17831 };
17832 #[cfg(feature = "arbitrary")]
17833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17834 use arbitrary::{Arbitrary, Unstructured};
17835 let mut buf = [0u8; 1024];
17836 rng.fill_bytes(&mut buf);
17837 let mut unstructured = Unstructured::new(&buf);
17838 Self::arbitrary(&mut unstructured).unwrap_or_default()
17839 }
17840}
17841impl Default for LOG_REQUEST_DATA_DATA {
17842 fn default() -> Self {
17843 Self::DEFAULT.clone()
17844 }
17845}
17846impl MessageData for LOG_REQUEST_DATA_DATA {
17847 type Message = MavMessage;
17848 const ID: u32 = 119u32;
17849 const NAME: &'static str = "LOG_REQUEST_DATA";
17850 const EXTRA_CRC: u8 = 116u8;
17851 const ENCODED_LEN: usize = 12usize;
17852 fn deser(
17853 _version: MavlinkVersion,
17854 __input: &[u8],
17855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17856 let avail_len = __input.len();
17857 let mut payload_buf = [0; Self::ENCODED_LEN];
17858 let mut buf = if avail_len < Self::ENCODED_LEN {
17859 payload_buf[0..avail_len].copy_from_slice(__input);
17860 Bytes::new(&payload_buf)
17861 } else {
17862 Bytes::new(__input)
17863 };
17864 let mut __struct = Self::default();
17865 __struct.ofs = buf.get_u32_le();
17866 __struct.count = buf.get_u32_le();
17867 __struct.id = buf.get_u16_le();
17868 __struct.target_system = buf.get_u8();
17869 __struct.target_component = buf.get_u8();
17870 Ok(__struct)
17871 }
17872 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17873 let mut __tmp = BytesMut::new(bytes);
17874 #[allow(clippy::absurd_extreme_comparisons)]
17875 #[allow(unused_comparisons)]
17876 if __tmp.remaining() < Self::ENCODED_LEN {
17877 panic!(
17878 "buffer is too small (need {} bytes, but got {})",
17879 Self::ENCODED_LEN,
17880 __tmp.remaining(),
17881 )
17882 }
17883 __tmp.put_u32_le(self.ofs);
17884 __tmp.put_u32_le(self.count);
17885 __tmp.put_u16_le(self.id);
17886 __tmp.put_u8(self.target_system);
17887 __tmp.put_u8(self.target_component);
17888 if matches!(version, MavlinkVersion::V2) {
17889 let len = __tmp.len();
17890 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17891 } else {
17892 __tmp.len()
17893 }
17894 }
17895}
17896#[doc = "id: 122"]
17897#[doc = "Stop log transfer and resume normal logging."]
17898#[derive(Debug, Clone, PartialEq)]
17899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17901pub struct LOG_REQUEST_END_DATA {
17902 #[doc = "System ID"]
17903 pub target_system: u8,
17904 #[doc = "Component ID"]
17905 pub target_component: u8,
17906}
17907impl LOG_REQUEST_END_DATA {
17908 pub const ENCODED_LEN: usize = 2usize;
17909 pub const DEFAULT: Self = Self {
17910 target_system: 0_u8,
17911 target_component: 0_u8,
17912 };
17913 #[cfg(feature = "arbitrary")]
17914 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17915 use arbitrary::{Arbitrary, Unstructured};
17916 let mut buf = [0u8; 1024];
17917 rng.fill_bytes(&mut buf);
17918 let mut unstructured = Unstructured::new(&buf);
17919 Self::arbitrary(&mut unstructured).unwrap_or_default()
17920 }
17921}
17922impl Default for LOG_REQUEST_END_DATA {
17923 fn default() -> Self {
17924 Self::DEFAULT.clone()
17925 }
17926}
17927impl MessageData for LOG_REQUEST_END_DATA {
17928 type Message = MavMessage;
17929 const ID: u32 = 122u32;
17930 const NAME: &'static str = "LOG_REQUEST_END";
17931 const EXTRA_CRC: u8 = 203u8;
17932 const ENCODED_LEN: usize = 2usize;
17933 fn deser(
17934 _version: MavlinkVersion,
17935 __input: &[u8],
17936 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17937 let avail_len = __input.len();
17938 let mut payload_buf = [0; Self::ENCODED_LEN];
17939 let mut buf = if avail_len < Self::ENCODED_LEN {
17940 payload_buf[0..avail_len].copy_from_slice(__input);
17941 Bytes::new(&payload_buf)
17942 } else {
17943 Bytes::new(__input)
17944 };
17945 let mut __struct = Self::default();
17946 __struct.target_system = buf.get_u8();
17947 __struct.target_component = buf.get_u8();
17948 Ok(__struct)
17949 }
17950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17951 let mut __tmp = BytesMut::new(bytes);
17952 #[allow(clippy::absurd_extreme_comparisons)]
17953 #[allow(unused_comparisons)]
17954 if __tmp.remaining() < Self::ENCODED_LEN {
17955 panic!(
17956 "buffer is too small (need {} bytes, but got {})",
17957 Self::ENCODED_LEN,
17958 __tmp.remaining(),
17959 )
17960 }
17961 __tmp.put_u8(self.target_system);
17962 __tmp.put_u8(self.target_component);
17963 if matches!(version, MavlinkVersion::V2) {
17964 let len = __tmp.len();
17965 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17966 } else {
17967 __tmp.len()
17968 }
17969 }
17970}
17971#[doc = "id: 117"]
17972#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
17973#[derive(Debug, Clone, PartialEq)]
17974#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17976pub struct LOG_REQUEST_LIST_DATA {
17977 #[doc = "First log id (0 for first available)"]
17978 pub start: u16,
17979 #[doc = "Last log id (0xffff for last available)"]
17980 pub end: u16,
17981 #[doc = "System ID"]
17982 pub target_system: u8,
17983 #[doc = "Component ID"]
17984 pub target_component: u8,
17985}
17986impl LOG_REQUEST_LIST_DATA {
17987 pub const ENCODED_LEN: usize = 6usize;
17988 pub const DEFAULT: Self = Self {
17989 start: 0_u16,
17990 end: 0_u16,
17991 target_system: 0_u8,
17992 target_component: 0_u8,
17993 };
17994 #[cfg(feature = "arbitrary")]
17995 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17996 use arbitrary::{Arbitrary, Unstructured};
17997 let mut buf = [0u8; 1024];
17998 rng.fill_bytes(&mut buf);
17999 let mut unstructured = Unstructured::new(&buf);
18000 Self::arbitrary(&mut unstructured).unwrap_or_default()
18001 }
18002}
18003impl Default for LOG_REQUEST_LIST_DATA {
18004 fn default() -> Self {
18005 Self::DEFAULT.clone()
18006 }
18007}
18008impl MessageData for LOG_REQUEST_LIST_DATA {
18009 type Message = MavMessage;
18010 const ID: u32 = 117u32;
18011 const NAME: &'static str = "LOG_REQUEST_LIST";
18012 const EXTRA_CRC: u8 = 128u8;
18013 const ENCODED_LEN: usize = 6usize;
18014 fn deser(
18015 _version: MavlinkVersion,
18016 __input: &[u8],
18017 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18018 let avail_len = __input.len();
18019 let mut payload_buf = [0; Self::ENCODED_LEN];
18020 let mut buf = if avail_len < Self::ENCODED_LEN {
18021 payload_buf[0..avail_len].copy_from_slice(__input);
18022 Bytes::new(&payload_buf)
18023 } else {
18024 Bytes::new(__input)
18025 };
18026 let mut __struct = Self::default();
18027 __struct.start = buf.get_u16_le();
18028 __struct.end = buf.get_u16_le();
18029 __struct.target_system = buf.get_u8();
18030 __struct.target_component = buf.get_u8();
18031 Ok(__struct)
18032 }
18033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18034 let mut __tmp = BytesMut::new(bytes);
18035 #[allow(clippy::absurd_extreme_comparisons)]
18036 #[allow(unused_comparisons)]
18037 if __tmp.remaining() < Self::ENCODED_LEN {
18038 panic!(
18039 "buffer is too small (need {} bytes, but got {})",
18040 Self::ENCODED_LEN,
18041 __tmp.remaining(),
18042 )
18043 }
18044 __tmp.put_u16_le(self.start);
18045 __tmp.put_u16_le(self.end);
18046 __tmp.put_u8(self.target_system);
18047 __tmp.put_u8(self.target_component);
18048 if matches!(version, MavlinkVersion::V2) {
18049 let len = __tmp.len();
18050 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18051 } else {
18052 __tmp.len()
18053 }
18054 }
18055}
18056#[doc = "id: 192"]
18057#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18058#[derive(Debug, Clone, PartialEq)]
18059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18061pub struct MAG_CAL_REPORT_DATA {
18062 #[doc = "RMS milligauss residuals."]
18063 pub fitness: f32,
18064 #[doc = "X offset."]
18065 pub ofs_x: f32,
18066 #[doc = "Y offset."]
18067 pub ofs_y: f32,
18068 #[doc = "Z offset."]
18069 pub ofs_z: f32,
18070 #[doc = "X diagonal (matrix 11)."]
18071 pub diag_x: f32,
18072 #[doc = "Y diagonal (matrix 22)."]
18073 pub diag_y: f32,
18074 #[doc = "Z diagonal (matrix 33)."]
18075 pub diag_z: f32,
18076 #[doc = "X off-diagonal (matrix 12 and 21)."]
18077 pub offdiag_x: f32,
18078 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18079 pub offdiag_y: f32,
18080 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18081 pub offdiag_z: f32,
18082 #[doc = "Compass being calibrated."]
18083 pub compass_id: u8,
18084 #[doc = "Bitmask of compasses being calibrated."]
18085 pub cal_mask: u8,
18086 #[doc = "Calibration Status."]
18087 pub cal_status: MagCalStatus,
18088 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18089 pub autosaved: u8,
18090 #[doc = "Confidence in orientation (higher is better)."]
18091 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18092 pub orientation_confidence: f32,
18093 #[doc = "orientation before calibration."]
18094 #[cfg_attr(feature = "serde", serde(default))]
18095 pub old_orientation: MavSensorOrientation,
18096 #[doc = "orientation after calibration."]
18097 #[cfg_attr(feature = "serde", serde(default))]
18098 pub new_orientation: MavSensorOrientation,
18099 #[doc = "field radius correction factor"]
18100 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18101 pub scale_factor: f32,
18102}
18103impl MAG_CAL_REPORT_DATA {
18104 pub const ENCODED_LEN: usize = 54usize;
18105 pub const DEFAULT: Self = Self {
18106 fitness: 0.0_f32,
18107 ofs_x: 0.0_f32,
18108 ofs_y: 0.0_f32,
18109 ofs_z: 0.0_f32,
18110 diag_x: 0.0_f32,
18111 diag_y: 0.0_f32,
18112 diag_z: 0.0_f32,
18113 offdiag_x: 0.0_f32,
18114 offdiag_y: 0.0_f32,
18115 offdiag_z: 0.0_f32,
18116 compass_id: 0_u8,
18117 cal_mask: 0_u8,
18118 cal_status: MagCalStatus::DEFAULT,
18119 autosaved: 0_u8,
18120 orientation_confidence: 0.0_f32,
18121 old_orientation: MavSensorOrientation::DEFAULT,
18122 new_orientation: MavSensorOrientation::DEFAULT,
18123 scale_factor: 0.0_f32,
18124 };
18125 #[cfg(feature = "arbitrary")]
18126 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18127 use arbitrary::{Arbitrary, Unstructured};
18128 let mut buf = [0u8; 1024];
18129 rng.fill_bytes(&mut buf);
18130 let mut unstructured = Unstructured::new(&buf);
18131 Self::arbitrary(&mut unstructured).unwrap_or_default()
18132 }
18133}
18134impl Default for MAG_CAL_REPORT_DATA {
18135 fn default() -> Self {
18136 Self::DEFAULT.clone()
18137 }
18138}
18139impl MessageData for MAG_CAL_REPORT_DATA {
18140 type Message = MavMessage;
18141 const ID: u32 = 192u32;
18142 const NAME: &'static str = "MAG_CAL_REPORT";
18143 const EXTRA_CRC: u8 = 36u8;
18144 const ENCODED_LEN: usize = 54usize;
18145 fn deser(
18146 _version: MavlinkVersion,
18147 __input: &[u8],
18148 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18149 let avail_len = __input.len();
18150 let mut payload_buf = [0; Self::ENCODED_LEN];
18151 let mut buf = if avail_len < Self::ENCODED_LEN {
18152 payload_buf[0..avail_len].copy_from_slice(__input);
18153 Bytes::new(&payload_buf)
18154 } else {
18155 Bytes::new(__input)
18156 };
18157 let mut __struct = Self::default();
18158 __struct.fitness = buf.get_f32_le();
18159 __struct.ofs_x = buf.get_f32_le();
18160 __struct.ofs_y = buf.get_f32_le();
18161 __struct.ofs_z = buf.get_f32_le();
18162 __struct.diag_x = buf.get_f32_le();
18163 __struct.diag_y = buf.get_f32_le();
18164 __struct.diag_z = buf.get_f32_le();
18165 __struct.offdiag_x = buf.get_f32_le();
18166 __struct.offdiag_y = buf.get_f32_le();
18167 __struct.offdiag_z = buf.get_f32_le();
18168 __struct.compass_id = buf.get_u8();
18169 __struct.cal_mask = buf.get_u8();
18170 let tmp = buf.get_u8();
18171 __struct.cal_status =
18172 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18173 enum_type: "MagCalStatus",
18174 value: tmp as u32,
18175 })?;
18176 __struct.autosaved = buf.get_u8();
18177 __struct.orientation_confidence = buf.get_f32_le();
18178 let tmp = buf.get_u8();
18179 __struct.old_orientation =
18180 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18181 enum_type: "MavSensorOrientation",
18182 value: tmp as u32,
18183 })?;
18184 let tmp = buf.get_u8();
18185 __struct.new_orientation =
18186 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18187 enum_type: "MavSensorOrientation",
18188 value: tmp as u32,
18189 })?;
18190 __struct.scale_factor = buf.get_f32_le();
18191 Ok(__struct)
18192 }
18193 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18194 let mut __tmp = BytesMut::new(bytes);
18195 #[allow(clippy::absurd_extreme_comparisons)]
18196 #[allow(unused_comparisons)]
18197 if __tmp.remaining() < Self::ENCODED_LEN {
18198 panic!(
18199 "buffer is too small (need {} bytes, but got {})",
18200 Self::ENCODED_LEN,
18201 __tmp.remaining(),
18202 )
18203 }
18204 __tmp.put_f32_le(self.fitness);
18205 __tmp.put_f32_le(self.ofs_x);
18206 __tmp.put_f32_le(self.ofs_y);
18207 __tmp.put_f32_le(self.ofs_z);
18208 __tmp.put_f32_le(self.diag_x);
18209 __tmp.put_f32_le(self.diag_y);
18210 __tmp.put_f32_le(self.diag_z);
18211 __tmp.put_f32_le(self.offdiag_x);
18212 __tmp.put_f32_le(self.offdiag_y);
18213 __tmp.put_f32_le(self.offdiag_z);
18214 __tmp.put_u8(self.compass_id);
18215 __tmp.put_u8(self.cal_mask);
18216 __tmp.put_u8(self.cal_status as u8);
18217 __tmp.put_u8(self.autosaved);
18218 __tmp.put_f32_le(self.orientation_confidence);
18219 __tmp.put_u8(self.old_orientation as u8);
18220 __tmp.put_u8(self.new_orientation as u8);
18221 __tmp.put_f32_le(self.scale_factor);
18222 if matches!(version, MavlinkVersion::V2) {
18223 let len = __tmp.len();
18224 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18225 } else {
18226 __tmp.len()
18227 }
18228 }
18229}
18230#[doc = "id: 69"]
18231#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18232#[derive(Debug, Clone, PartialEq)]
18233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18235pub struct MANUAL_CONTROL_DATA {
18236 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18237 pub x: i16,
18238 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18239 pub y: i16,
18240 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18241 pub z: i16,
18242 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18243 pub r: i16,
18244 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18245 pub buttons: u16,
18246 #[doc = "The system to be controlled."]
18247 pub target: u8,
18248 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18249 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18250 pub buttons2: u16,
18251 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18252 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18253 pub enabled_extensions: u8,
18254 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18255 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18256 pub s: i16,
18257 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18258 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18259 pub t: i16,
18260 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18261 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18262 pub aux1: i16,
18263 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18264 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18265 pub aux2: i16,
18266 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18267 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18268 pub aux3: i16,
18269 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18270 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18271 pub aux4: i16,
18272 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18273 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18274 pub aux5: i16,
18275 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18276 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18277 pub aux6: i16,
18278}
18279impl MANUAL_CONTROL_DATA {
18280 pub const ENCODED_LEN: usize = 30usize;
18281 pub const DEFAULT: Self = Self {
18282 x: 0_i16,
18283 y: 0_i16,
18284 z: 0_i16,
18285 r: 0_i16,
18286 buttons: 0_u16,
18287 target: 0_u8,
18288 buttons2: 0_u16,
18289 enabled_extensions: 0_u8,
18290 s: 0_i16,
18291 t: 0_i16,
18292 aux1: 0_i16,
18293 aux2: 0_i16,
18294 aux3: 0_i16,
18295 aux4: 0_i16,
18296 aux5: 0_i16,
18297 aux6: 0_i16,
18298 };
18299 #[cfg(feature = "arbitrary")]
18300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18301 use arbitrary::{Arbitrary, Unstructured};
18302 let mut buf = [0u8; 1024];
18303 rng.fill_bytes(&mut buf);
18304 let mut unstructured = Unstructured::new(&buf);
18305 Self::arbitrary(&mut unstructured).unwrap_or_default()
18306 }
18307}
18308impl Default for MANUAL_CONTROL_DATA {
18309 fn default() -> Self {
18310 Self::DEFAULT.clone()
18311 }
18312}
18313impl MessageData for MANUAL_CONTROL_DATA {
18314 type Message = MavMessage;
18315 const ID: u32 = 69u32;
18316 const NAME: &'static str = "MANUAL_CONTROL";
18317 const EXTRA_CRC: u8 = 243u8;
18318 const ENCODED_LEN: usize = 30usize;
18319 fn deser(
18320 _version: MavlinkVersion,
18321 __input: &[u8],
18322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18323 let avail_len = __input.len();
18324 let mut payload_buf = [0; Self::ENCODED_LEN];
18325 let mut buf = if avail_len < Self::ENCODED_LEN {
18326 payload_buf[0..avail_len].copy_from_slice(__input);
18327 Bytes::new(&payload_buf)
18328 } else {
18329 Bytes::new(__input)
18330 };
18331 let mut __struct = Self::default();
18332 __struct.x = buf.get_i16_le();
18333 __struct.y = buf.get_i16_le();
18334 __struct.z = buf.get_i16_le();
18335 __struct.r = buf.get_i16_le();
18336 __struct.buttons = buf.get_u16_le();
18337 __struct.target = buf.get_u8();
18338 __struct.buttons2 = buf.get_u16_le();
18339 __struct.enabled_extensions = buf.get_u8();
18340 __struct.s = buf.get_i16_le();
18341 __struct.t = buf.get_i16_le();
18342 __struct.aux1 = buf.get_i16_le();
18343 __struct.aux2 = buf.get_i16_le();
18344 __struct.aux3 = buf.get_i16_le();
18345 __struct.aux4 = buf.get_i16_le();
18346 __struct.aux5 = buf.get_i16_le();
18347 __struct.aux6 = buf.get_i16_le();
18348 Ok(__struct)
18349 }
18350 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18351 let mut __tmp = BytesMut::new(bytes);
18352 #[allow(clippy::absurd_extreme_comparisons)]
18353 #[allow(unused_comparisons)]
18354 if __tmp.remaining() < Self::ENCODED_LEN {
18355 panic!(
18356 "buffer is too small (need {} bytes, but got {})",
18357 Self::ENCODED_LEN,
18358 __tmp.remaining(),
18359 )
18360 }
18361 __tmp.put_i16_le(self.x);
18362 __tmp.put_i16_le(self.y);
18363 __tmp.put_i16_le(self.z);
18364 __tmp.put_i16_le(self.r);
18365 __tmp.put_u16_le(self.buttons);
18366 __tmp.put_u8(self.target);
18367 __tmp.put_u16_le(self.buttons2);
18368 __tmp.put_u8(self.enabled_extensions);
18369 __tmp.put_i16_le(self.s);
18370 __tmp.put_i16_le(self.t);
18371 __tmp.put_i16_le(self.aux1);
18372 __tmp.put_i16_le(self.aux2);
18373 __tmp.put_i16_le(self.aux3);
18374 __tmp.put_i16_le(self.aux4);
18375 __tmp.put_i16_le(self.aux5);
18376 __tmp.put_i16_le(self.aux6);
18377 if matches!(version, MavlinkVersion::V2) {
18378 let len = __tmp.len();
18379 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18380 } else {
18381 __tmp.len()
18382 }
18383 }
18384}
18385#[doc = "id: 81"]
18386#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18387#[derive(Debug, Clone, PartialEq)]
18388#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18389#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18390pub struct MANUAL_SETPOINT_DATA {
18391 #[doc = "Timestamp (time since system boot)."]
18392 pub time_boot_ms: u32,
18393 #[doc = "Desired roll rate"]
18394 pub roll: f32,
18395 #[doc = "Desired pitch rate"]
18396 pub pitch: f32,
18397 #[doc = "Desired yaw rate"]
18398 pub yaw: f32,
18399 #[doc = "Collective thrust, normalized to 0 .. 1"]
18400 pub thrust: f32,
18401 #[doc = "Flight mode switch position, 0.. 255"]
18402 pub mode_switch: u8,
18403 #[doc = "Override mode switch position, 0.. 255"]
18404 pub manual_override_switch: u8,
18405}
18406impl MANUAL_SETPOINT_DATA {
18407 pub const ENCODED_LEN: usize = 22usize;
18408 pub const DEFAULT: Self = Self {
18409 time_boot_ms: 0_u32,
18410 roll: 0.0_f32,
18411 pitch: 0.0_f32,
18412 yaw: 0.0_f32,
18413 thrust: 0.0_f32,
18414 mode_switch: 0_u8,
18415 manual_override_switch: 0_u8,
18416 };
18417 #[cfg(feature = "arbitrary")]
18418 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18419 use arbitrary::{Arbitrary, Unstructured};
18420 let mut buf = [0u8; 1024];
18421 rng.fill_bytes(&mut buf);
18422 let mut unstructured = Unstructured::new(&buf);
18423 Self::arbitrary(&mut unstructured).unwrap_or_default()
18424 }
18425}
18426impl Default for MANUAL_SETPOINT_DATA {
18427 fn default() -> Self {
18428 Self::DEFAULT.clone()
18429 }
18430}
18431impl MessageData for MANUAL_SETPOINT_DATA {
18432 type Message = MavMessage;
18433 const ID: u32 = 81u32;
18434 const NAME: &'static str = "MANUAL_SETPOINT";
18435 const EXTRA_CRC: u8 = 106u8;
18436 const ENCODED_LEN: usize = 22usize;
18437 fn deser(
18438 _version: MavlinkVersion,
18439 __input: &[u8],
18440 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18441 let avail_len = __input.len();
18442 let mut payload_buf = [0; Self::ENCODED_LEN];
18443 let mut buf = if avail_len < Self::ENCODED_LEN {
18444 payload_buf[0..avail_len].copy_from_slice(__input);
18445 Bytes::new(&payload_buf)
18446 } else {
18447 Bytes::new(__input)
18448 };
18449 let mut __struct = Self::default();
18450 __struct.time_boot_ms = buf.get_u32_le();
18451 __struct.roll = buf.get_f32_le();
18452 __struct.pitch = buf.get_f32_le();
18453 __struct.yaw = buf.get_f32_le();
18454 __struct.thrust = buf.get_f32_le();
18455 __struct.mode_switch = buf.get_u8();
18456 __struct.manual_override_switch = buf.get_u8();
18457 Ok(__struct)
18458 }
18459 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18460 let mut __tmp = BytesMut::new(bytes);
18461 #[allow(clippy::absurd_extreme_comparisons)]
18462 #[allow(unused_comparisons)]
18463 if __tmp.remaining() < Self::ENCODED_LEN {
18464 panic!(
18465 "buffer is too small (need {} bytes, but got {})",
18466 Self::ENCODED_LEN,
18467 __tmp.remaining(),
18468 )
18469 }
18470 __tmp.put_u32_le(self.time_boot_ms);
18471 __tmp.put_f32_le(self.roll);
18472 __tmp.put_f32_le(self.pitch);
18473 __tmp.put_f32_le(self.yaw);
18474 __tmp.put_f32_le(self.thrust);
18475 __tmp.put_u8(self.mode_switch);
18476 __tmp.put_u8(self.manual_override_switch);
18477 if matches!(version, MavlinkVersion::V2) {
18478 let len = __tmp.len();
18479 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18480 } else {
18481 __tmp.len()
18482 }
18483 }
18484}
18485#[doc = "id: 249"]
18486#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18487#[derive(Debug, Clone, PartialEq)]
18488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18490pub struct MEMORY_VECT_DATA {
18491 #[doc = "Starting address of the debug variables"]
18492 pub address: u16,
18493 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18494 pub ver: u8,
18495 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18496 pub mavtype: u8,
18497 #[doc = "Memory contents at specified address"]
18498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18499 pub value: [i8; 32],
18500}
18501impl MEMORY_VECT_DATA {
18502 pub const ENCODED_LEN: usize = 36usize;
18503 pub const DEFAULT: Self = Self {
18504 address: 0_u16,
18505 ver: 0_u8,
18506 mavtype: 0_u8,
18507 value: [0_i8; 32usize],
18508 };
18509 #[cfg(feature = "arbitrary")]
18510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18511 use arbitrary::{Arbitrary, Unstructured};
18512 let mut buf = [0u8; 1024];
18513 rng.fill_bytes(&mut buf);
18514 let mut unstructured = Unstructured::new(&buf);
18515 Self::arbitrary(&mut unstructured).unwrap_or_default()
18516 }
18517}
18518impl Default for MEMORY_VECT_DATA {
18519 fn default() -> Self {
18520 Self::DEFAULT.clone()
18521 }
18522}
18523impl MessageData for MEMORY_VECT_DATA {
18524 type Message = MavMessage;
18525 const ID: u32 = 249u32;
18526 const NAME: &'static str = "MEMORY_VECT";
18527 const EXTRA_CRC: u8 = 204u8;
18528 const ENCODED_LEN: usize = 36usize;
18529 fn deser(
18530 _version: MavlinkVersion,
18531 __input: &[u8],
18532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18533 let avail_len = __input.len();
18534 let mut payload_buf = [0; Self::ENCODED_LEN];
18535 let mut buf = if avail_len < Self::ENCODED_LEN {
18536 payload_buf[0..avail_len].copy_from_slice(__input);
18537 Bytes::new(&payload_buf)
18538 } else {
18539 Bytes::new(__input)
18540 };
18541 let mut __struct = Self::default();
18542 __struct.address = buf.get_u16_le();
18543 __struct.ver = buf.get_u8();
18544 __struct.mavtype = buf.get_u8();
18545 for v in &mut __struct.value {
18546 let val = buf.get_i8();
18547 *v = val;
18548 }
18549 Ok(__struct)
18550 }
18551 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18552 let mut __tmp = BytesMut::new(bytes);
18553 #[allow(clippy::absurd_extreme_comparisons)]
18554 #[allow(unused_comparisons)]
18555 if __tmp.remaining() < Self::ENCODED_LEN {
18556 panic!(
18557 "buffer is too small (need {} bytes, but got {})",
18558 Self::ENCODED_LEN,
18559 __tmp.remaining(),
18560 )
18561 }
18562 __tmp.put_u16_le(self.address);
18563 __tmp.put_u8(self.ver);
18564 __tmp.put_u8(self.mavtype);
18565 for val in &self.value {
18566 __tmp.put_i8(*val);
18567 }
18568 if matches!(version, MavlinkVersion::V2) {
18569 let len = __tmp.len();
18570 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18571 } else {
18572 __tmp.len()
18573 }
18574 }
18575}
18576#[doc = "id: 244"]
18577#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18578#[derive(Debug, Clone, PartialEq)]
18579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18581pub struct MESSAGE_INTERVAL_DATA {
18582 #[doc = "0 indicates the interval at which it is sent."]
18583 pub interval_us: i32,
18584 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18585 pub message_id: u16,
18586}
18587impl MESSAGE_INTERVAL_DATA {
18588 pub const ENCODED_LEN: usize = 6usize;
18589 pub const DEFAULT: Self = Self {
18590 interval_us: 0_i32,
18591 message_id: 0_u16,
18592 };
18593 #[cfg(feature = "arbitrary")]
18594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18595 use arbitrary::{Arbitrary, Unstructured};
18596 let mut buf = [0u8; 1024];
18597 rng.fill_bytes(&mut buf);
18598 let mut unstructured = Unstructured::new(&buf);
18599 Self::arbitrary(&mut unstructured).unwrap_or_default()
18600 }
18601}
18602impl Default for MESSAGE_INTERVAL_DATA {
18603 fn default() -> Self {
18604 Self::DEFAULT.clone()
18605 }
18606}
18607impl MessageData for MESSAGE_INTERVAL_DATA {
18608 type Message = MavMessage;
18609 const ID: u32 = 244u32;
18610 const NAME: &'static str = "MESSAGE_INTERVAL";
18611 const EXTRA_CRC: u8 = 95u8;
18612 const ENCODED_LEN: usize = 6usize;
18613 fn deser(
18614 _version: MavlinkVersion,
18615 __input: &[u8],
18616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18617 let avail_len = __input.len();
18618 let mut payload_buf = [0; Self::ENCODED_LEN];
18619 let mut buf = if avail_len < Self::ENCODED_LEN {
18620 payload_buf[0..avail_len].copy_from_slice(__input);
18621 Bytes::new(&payload_buf)
18622 } else {
18623 Bytes::new(__input)
18624 };
18625 let mut __struct = Self::default();
18626 __struct.interval_us = buf.get_i32_le();
18627 __struct.message_id = buf.get_u16_le();
18628 Ok(__struct)
18629 }
18630 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18631 let mut __tmp = BytesMut::new(bytes);
18632 #[allow(clippy::absurd_extreme_comparisons)]
18633 #[allow(unused_comparisons)]
18634 if __tmp.remaining() < Self::ENCODED_LEN {
18635 panic!(
18636 "buffer is too small (need {} bytes, but got {})",
18637 Self::ENCODED_LEN,
18638 __tmp.remaining(),
18639 )
18640 }
18641 __tmp.put_i32_le(self.interval_us);
18642 __tmp.put_u16_le(self.message_id);
18643 if matches!(version, MavlinkVersion::V2) {
18644 let len = __tmp.len();
18645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18646 } else {
18647 __tmp.len()
18648 }
18649 }
18650}
18651#[doc = "id: 47"]
18652#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
18653#[derive(Debug, Clone, PartialEq)]
18654#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18656pub struct MISSION_ACK_DATA {
18657 #[doc = "System ID"]
18658 pub target_system: u8,
18659 #[doc = "Component ID"]
18660 pub target_component: u8,
18661 #[doc = "Mission result."]
18662 pub mavtype: MavMissionResult,
18663 #[doc = "Mission type."]
18664 #[cfg_attr(feature = "serde", serde(default))]
18665 pub mission_type: MavMissionType,
18666 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
18667 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18668 pub opaque_id: u32,
18669}
18670impl MISSION_ACK_DATA {
18671 pub const ENCODED_LEN: usize = 8usize;
18672 pub const DEFAULT: Self = Self {
18673 target_system: 0_u8,
18674 target_component: 0_u8,
18675 mavtype: MavMissionResult::DEFAULT,
18676 mission_type: MavMissionType::DEFAULT,
18677 opaque_id: 0_u32,
18678 };
18679 #[cfg(feature = "arbitrary")]
18680 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18681 use arbitrary::{Arbitrary, Unstructured};
18682 let mut buf = [0u8; 1024];
18683 rng.fill_bytes(&mut buf);
18684 let mut unstructured = Unstructured::new(&buf);
18685 Self::arbitrary(&mut unstructured).unwrap_or_default()
18686 }
18687}
18688impl Default for MISSION_ACK_DATA {
18689 fn default() -> Self {
18690 Self::DEFAULT.clone()
18691 }
18692}
18693impl MessageData for MISSION_ACK_DATA {
18694 type Message = MavMessage;
18695 const ID: u32 = 47u32;
18696 const NAME: &'static str = "MISSION_ACK";
18697 const EXTRA_CRC: u8 = 153u8;
18698 const ENCODED_LEN: usize = 8usize;
18699 fn deser(
18700 _version: MavlinkVersion,
18701 __input: &[u8],
18702 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18703 let avail_len = __input.len();
18704 let mut payload_buf = [0; Self::ENCODED_LEN];
18705 let mut buf = if avail_len < Self::ENCODED_LEN {
18706 payload_buf[0..avail_len].copy_from_slice(__input);
18707 Bytes::new(&payload_buf)
18708 } else {
18709 Bytes::new(__input)
18710 };
18711 let mut __struct = Self::default();
18712 __struct.target_system = buf.get_u8();
18713 __struct.target_component = buf.get_u8();
18714 let tmp = buf.get_u8();
18715 __struct.mavtype =
18716 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18717 enum_type: "MavMissionResult",
18718 value: tmp as u32,
18719 })?;
18720 let tmp = buf.get_u8();
18721 __struct.mission_type =
18722 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18723 enum_type: "MavMissionType",
18724 value: tmp as u32,
18725 })?;
18726 __struct.opaque_id = buf.get_u32_le();
18727 Ok(__struct)
18728 }
18729 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18730 let mut __tmp = BytesMut::new(bytes);
18731 #[allow(clippy::absurd_extreme_comparisons)]
18732 #[allow(unused_comparisons)]
18733 if __tmp.remaining() < Self::ENCODED_LEN {
18734 panic!(
18735 "buffer is too small (need {} bytes, but got {})",
18736 Self::ENCODED_LEN,
18737 __tmp.remaining(),
18738 )
18739 }
18740 __tmp.put_u8(self.target_system);
18741 __tmp.put_u8(self.target_component);
18742 __tmp.put_u8(self.mavtype as u8);
18743 __tmp.put_u8(self.mission_type as u8);
18744 __tmp.put_u32_le(self.opaque_id);
18745 if matches!(version, MavlinkVersion::V2) {
18746 let len = __tmp.len();
18747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18748 } else {
18749 __tmp.len()
18750 }
18751 }
18752}
18753#[doc = "id: 45"]
18754#[doc = "Delete all mission items at once."]
18755#[derive(Debug, Clone, PartialEq)]
18756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18757#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18758pub struct MISSION_CLEAR_ALL_DATA {
18759 #[doc = "System ID"]
18760 pub target_system: u8,
18761 #[doc = "Component ID"]
18762 pub target_component: u8,
18763 #[doc = "Mission type."]
18764 #[cfg_attr(feature = "serde", serde(default))]
18765 pub mission_type: MavMissionType,
18766}
18767impl MISSION_CLEAR_ALL_DATA {
18768 pub const ENCODED_LEN: usize = 3usize;
18769 pub const DEFAULT: Self = Self {
18770 target_system: 0_u8,
18771 target_component: 0_u8,
18772 mission_type: MavMissionType::DEFAULT,
18773 };
18774 #[cfg(feature = "arbitrary")]
18775 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18776 use arbitrary::{Arbitrary, Unstructured};
18777 let mut buf = [0u8; 1024];
18778 rng.fill_bytes(&mut buf);
18779 let mut unstructured = Unstructured::new(&buf);
18780 Self::arbitrary(&mut unstructured).unwrap_or_default()
18781 }
18782}
18783impl Default for MISSION_CLEAR_ALL_DATA {
18784 fn default() -> Self {
18785 Self::DEFAULT.clone()
18786 }
18787}
18788impl MessageData for MISSION_CLEAR_ALL_DATA {
18789 type Message = MavMessage;
18790 const ID: u32 = 45u32;
18791 const NAME: &'static str = "MISSION_CLEAR_ALL";
18792 const EXTRA_CRC: u8 = 232u8;
18793 const ENCODED_LEN: usize = 3usize;
18794 fn deser(
18795 _version: MavlinkVersion,
18796 __input: &[u8],
18797 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18798 let avail_len = __input.len();
18799 let mut payload_buf = [0; Self::ENCODED_LEN];
18800 let mut buf = if avail_len < Self::ENCODED_LEN {
18801 payload_buf[0..avail_len].copy_from_slice(__input);
18802 Bytes::new(&payload_buf)
18803 } else {
18804 Bytes::new(__input)
18805 };
18806 let mut __struct = Self::default();
18807 __struct.target_system = buf.get_u8();
18808 __struct.target_component = buf.get_u8();
18809 let tmp = buf.get_u8();
18810 __struct.mission_type =
18811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18812 enum_type: "MavMissionType",
18813 value: tmp as u32,
18814 })?;
18815 Ok(__struct)
18816 }
18817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18818 let mut __tmp = BytesMut::new(bytes);
18819 #[allow(clippy::absurd_extreme_comparisons)]
18820 #[allow(unused_comparisons)]
18821 if __tmp.remaining() < Self::ENCODED_LEN {
18822 panic!(
18823 "buffer is too small (need {} bytes, but got {})",
18824 Self::ENCODED_LEN,
18825 __tmp.remaining(),
18826 )
18827 }
18828 __tmp.put_u8(self.target_system);
18829 __tmp.put_u8(self.target_component);
18830 __tmp.put_u8(self.mission_type as u8);
18831 if matches!(version, MavlinkVersion::V2) {
18832 let len = __tmp.len();
18833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18834 } else {
18835 __tmp.len()
18836 }
18837 }
18838}
18839#[doc = "id: 44"]
18840#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
18841#[derive(Debug, Clone, PartialEq)]
18842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18844pub struct MISSION_COUNT_DATA {
18845 #[doc = "Number of mission items in the sequence"]
18846 pub count: u16,
18847 #[doc = "System ID"]
18848 pub target_system: u8,
18849 #[doc = "Component ID"]
18850 pub target_component: u8,
18851 #[doc = "Mission type."]
18852 #[cfg_attr(feature = "serde", serde(default))]
18853 pub mission_type: MavMissionType,
18854 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
18855 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18856 pub opaque_id: u32,
18857}
18858impl MISSION_COUNT_DATA {
18859 pub const ENCODED_LEN: usize = 9usize;
18860 pub const DEFAULT: Self = Self {
18861 count: 0_u16,
18862 target_system: 0_u8,
18863 target_component: 0_u8,
18864 mission_type: MavMissionType::DEFAULT,
18865 opaque_id: 0_u32,
18866 };
18867 #[cfg(feature = "arbitrary")]
18868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18869 use arbitrary::{Arbitrary, Unstructured};
18870 let mut buf = [0u8; 1024];
18871 rng.fill_bytes(&mut buf);
18872 let mut unstructured = Unstructured::new(&buf);
18873 Self::arbitrary(&mut unstructured).unwrap_or_default()
18874 }
18875}
18876impl Default for MISSION_COUNT_DATA {
18877 fn default() -> Self {
18878 Self::DEFAULT.clone()
18879 }
18880}
18881impl MessageData for MISSION_COUNT_DATA {
18882 type Message = MavMessage;
18883 const ID: u32 = 44u32;
18884 const NAME: &'static str = "MISSION_COUNT";
18885 const EXTRA_CRC: u8 = 221u8;
18886 const ENCODED_LEN: usize = 9usize;
18887 fn deser(
18888 _version: MavlinkVersion,
18889 __input: &[u8],
18890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18891 let avail_len = __input.len();
18892 let mut payload_buf = [0; Self::ENCODED_LEN];
18893 let mut buf = if avail_len < Self::ENCODED_LEN {
18894 payload_buf[0..avail_len].copy_from_slice(__input);
18895 Bytes::new(&payload_buf)
18896 } else {
18897 Bytes::new(__input)
18898 };
18899 let mut __struct = Self::default();
18900 __struct.count = buf.get_u16_le();
18901 __struct.target_system = buf.get_u8();
18902 __struct.target_component = buf.get_u8();
18903 let tmp = buf.get_u8();
18904 __struct.mission_type =
18905 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18906 enum_type: "MavMissionType",
18907 value: tmp as u32,
18908 })?;
18909 __struct.opaque_id = buf.get_u32_le();
18910 Ok(__struct)
18911 }
18912 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18913 let mut __tmp = BytesMut::new(bytes);
18914 #[allow(clippy::absurd_extreme_comparisons)]
18915 #[allow(unused_comparisons)]
18916 if __tmp.remaining() < Self::ENCODED_LEN {
18917 panic!(
18918 "buffer is too small (need {} bytes, but got {})",
18919 Self::ENCODED_LEN,
18920 __tmp.remaining(),
18921 )
18922 }
18923 __tmp.put_u16_le(self.count);
18924 __tmp.put_u8(self.target_system);
18925 __tmp.put_u8(self.target_component);
18926 __tmp.put_u8(self.mission_type as u8);
18927 __tmp.put_u32_le(self.opaque_id);
18928 if matches!(version, MavlinkVersion::V2) {
18929 let len = __tmp.len();
18930 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18931 } else {
18932 __tmp.len()
18933 }
18934 }
18935}
18936#[doc = "id: 42"]
18937#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
18938#[derive(Debug, Clone, PartialEq)]
18939#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18940#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18941pub struct MISSION_CURRENT_DATA {
18942 #[doc = "Sequence"]
18943 pub seq: u16,
18944 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
18945 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18946 pub total: u16,
18947 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
18948 #[cfg_attr(feature = "serde", serde(default))]
18949 pub mission_state: MissionState,
18950 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
18951 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18952 pub mission_mode: u8,
18953 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
18954 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18955 pub mission_id: u32,
18956 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
18957 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18958 pub fence_id: u32,
18959 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
18960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18961 pub rally_points_id: u32,
18962}
18963impl MISSION_CURRENT_DATA {
18964 pub const ENCODED_LEN: usize = 18usize;
18965 pub const DEFAULT: Self = Self {
18966 seq: 0_u16,
18967 total: 0_u16,
18968 mission_state: MissionState::DEFAULT,
18969 mission_mode: 0_u8,
18970 mission_id: 0_u32,
18971 fence_id: 0_u32,
18972 rally_points_id: 0_u32,
18973 };
18974 #[cfg(feature = "arbitrary")]
18975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18976 use arbitrary::{Arbitrary, Unstructured};
18977 let mut buf = [0u8; 1024];
18978 rng.fill_bytes(&mut buf);
18979 let mut unstructured = Unstructured::new(&buf);
18980 Self::arbitrary(&mut unstructured).unwrap_or_default()
18981 }
18982}
18983impl Default for MISSION_CURRENT_DATA {
18984 fn default() -> Self {
18985 Self::DEFAULT.clone()
18986 }
18987}
18988impl MessageData for MISSION_CURRENT_DATA {
18989 type Message = MavMessage;
18990 const ID: u32 = 42u32;
18991 const NAME: &'static str = "MISSION_CURRENT";
18992 const EXTRA_CRC: u8 = 28u8;
18993 const ENCODED_LEN: usize = 18usize;
18994 fn deser(
18995 _version: MavlinkVersion,
18996 __input: &[u8],
18997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18998 let avail_len = __input.len();
18999 let mut payload_buf = [0; Self::ENCODED_LEN];
19000 let mut buf = if avail_len < Self::ENCODED_LEN {
19001 payload_buf[0..avail_len].copy_from_slice(__input);
19002 Bytes::new(&payload_buf)
19003 } else {
19004 Bytes::new(__input)
19005 };
19006 let mut __struct = Self::default();
19007 __struct.seq = buf.get_u16_le();
19008 __struct.total = buf.get_u16_le();
19009 let tmp = buf.get_u8();
19010 __struct.mission_state =
19011 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19012 enum_type: "MissionState",
19013 value: tmp as u32,
19014 })?;
19015 __struct.mission_mode = buf.get_u8();
19016 __struct.mission_id = buf.get_u32_le();
19017 __struct.fence_id = buf.get_u32_le();
19018 __struct.rally_points_id = buf.get_u32_le();
19019 Ok(__struct)
19020 }
19021 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19022 let mut __tmp = BytesMut::new(bytes);
19023 #[allow(clippy::absurd_extreme_comparisons)]
19024 #[allow(unused_comparisons)]
19025 if __tmp.remaining() < Self::ENCODED_LEN {
19026 panic!(
19027 "buffer is too small (need {} bytes, but got {})",
19028 Self::ENCODED_LEN,
19029 __tmp.remaining(),
19030 )
19031 }
19032 __tmp.put_u16_le(self.seq);
19033 __tmp.put_u16_le(self.total);
19034 __tmp.put_u8(self.mission_state as u8);
19035 __tmp.put_u8(self.mission_mode);
19036 __tmp.put_u32_le(self.mission_id);
19037 __tmp.put_u32_le(self.fence_id);
19038 __tmp.put_u32_le(self.rally_points_id);
19039 if matches!(version, MavlinkVersion::V2) {
19040 let len = __tmp.len();
19041 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19042 } else {
19043 __tmp.len()
19044 }
19045 }
19046}
19047#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19048#[doc = "id: 39"]
19049#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19050#[derive(Debug, Clone, PartialEq)]
19051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19053pub struct MISSION_ITEM_DATA {
19054 #[doc = "PARAM1, see MAV_CMD enum"]
19055 pub param1: f32,
19056 #[doc = "PARAM2, see MAV_CMD enum"]
19057 pub param2: f32,
19058 #[doc = "PARAM3, see MAV_CMD enum"]
19059 pub param3: f32,
19060 #[doc = "PARAM4, see MAV_CMD enum"]
19061 pub param4: f32,
19062 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19063 pub x: f32,
19064 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19065 pub y: f32,
19066 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19067 pub z: f32,
19068 #[doc = "Sequence"]
19069 pub seq: u16,
19070 #[doc = "The scheduled action for the waypoint."]
19071 pub command: MavCmd,
19072 #[doc = "System ID"]
19073 pub target_system: u8,
19074 #[doc = "Component ID"]
19075 pub target_component: u8,
19076 #[doc = "The coordinate system of the waypoint."]
19077 pub frame: MavFrame,
19078 #[doc = "false:0, true:1"]
19079 pub current: u8,
19080 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19081 pub autocontinue: u8,
19082 #[doc = "Mission type."]
19083 #[cfg_attr(feature = "serde", serde(default))]
19084 pub mission_type: MavMissionType,
19085}
19086impl MISSION_ITEM_DATA {
19087 pub const ENCODED_LEN: usize = 38usize;
19088 pub const DEFAULT: Self = Self {
19089 param1: 0.0_f32,
19090 param2: 0.0_f32,
19091 param3: 0.0_f32,
19092 param4: 0.0_f32,
19093 x: 0.0_f32,
19094 y: 0.0_f32,
19095 z: 0.0_f32,
19096 seq: 0_u16,
19097 command: MavCmd::DEFAULT,
19098 target_system: 0_u8,
19099 target_component: 0_u8,
19100 frame: MavFrame::DEFAULT,
19101 current: 0_u8,
19102 autocontinue: 0_u8,
19103 mission_type: MavMissionType::DEFAULT,
19104 };
19105 #[cfg(feature = "arbitrary")]
19106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19107 use arbitrary::{Arbitrary, Unstructured};
19108 let mut buf = [0u8; 1024];
19109 rng.fill_bytes(&mut buf);
19110 let mut unstructured = Unstructured::new(&buf);
19111 Self::arbitrary(&mut unstructured).unwrap_or_default()
19112 }
19113}
19114impl Default for MISSION_ITEM_DATA {
19115 fn default() -> Self {
19116 Self::DEFAULT.clone()
19117 }
19118}
19119impl MessageData for MISSION_ITEM_DATA {
19120 type Message = MavMessage;
19121 const ID: u32 = 39u32;
19122 const NAME: &'static str = "MISSION_ITEM";
19123 const EXTRA_CRC: u8 = 254u8;
19124 const ENCODED_LEN: usize = 38usize;
19125 fn deser(
19126 _version: MavlinkVersion,
19127 __input: &[u8],
19128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19129 let avail_len = __input.len();
19130 let mut payload_buf = [0; Self::ENCODED_LEN];
19131 let mut buf = if avail_len < Self::ENCODED_LEN {
19132 payload_buf[0..avail_len].copy_from_slice(__input);
19133 Bytes::new(&payload_buf)
19134 } else {
19135 Bytes::new(__input)
19136 };
19137 let mut __struct = Self::default();
19138 __struct.param1 = buf.get_f32_le();
19139 __struct.param2 = buf.get_f32_le();
19140 __struct.param3 = buf.get_f32_le();
19141 __struct.param4 = buf.get_f32_le();
19142 __struct.x = buf.get_f32_le();
19143 __struct.y = buf.get_f32_le();
19144 __struct.z = buf.get_f32_le();
19145 __struct.seq = buf.get_u16_le();
19146 let tmp = buf.get_u16_le();
19147 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19148 ::mavlink_core::error::ParserError::InvalidEnum {
19149 enum_type: "MavCmd",
19150 value: tmp as u32,
19151 },
19152 )?;
19153 __struct.target_system = buf.get_u8();
19154 __struct.target_component = buf.get_u8();
19155 let tmp = buf.get_u8();
19156 __struct.frame =
19157 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19158 enum_type: "MavFrame",
19159 value: tmp as u32,
19160 })?;
19161 __struct.current = buf.get_u8();
19162 __struct.autocontinue = buf.get_u8();
19163 let tmp = buf.get_u8();
19164 __struct.mission_type =
19165 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19166 enum_type: "MavMissionType",
19167 value: tmp as u32,
19168 })?;
19169 Ok(__struct)
19170 }
19171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19172 let mut __tmp = BytesMut::new(bytes);
19173 #[allow(clippy::absurd_extreme_comparisons)]
19174 #[allow(unused_comparisons)]
19175 if __tmp.remaining() < Self::ENCODED_LEN {
19176 panic!(
19177 "buffer is too small (need {} bytes, but got {})",
19178 Self::ENCODED_LEN,
19179 __tmp.remaining(),
19180 )
19181 }
19182 __tmp.put_f32_le(self.param1);
19183 __tmp.put_f32_le(self.param2);
19184 __tmp.put_f32_le(self.param3);
19185 __tmp.put_f32_le(self.param4);
19186 __tmp.put_f32_le(self.x);
19187 __tmp.put_f32_le(self.y);
19188 __tmp.put_f32_le(self.z);
19189 __tmp.put_u16_le(self.seq);
19190 __tmp.put_u16_le(self.command as u16);
19191 __tmp.put_u8(self.target_system);
19192 __tmp.put_u8(self.target_component);
19193 __tmp.put_u8(self.frame as u8);
19194 __tmp.put_u8(self.current);
19195 __tmp.put_u8(self.autocontinue);
19196 __tmp.put_u8(self.mission_type as u8);
19197 if matches!(version, MavlinkVersion::V2) {
19198 let len = __tmp.len();
19199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19200 } else {
19201 __tmp.len()
19202 }
19203 }
19204}
19205#[doc = "id: 73"]
19206#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19207#[derive(Debug, Clone, PartialEq)]
19208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19210pub struct MISSION_ITEM_INT_DATA {
19211 #[doc = "PARAM1, see MAV_CMD enum"]
19212 pub param1: f32,
19213 #[doc = "PARAM2, see MAV_CMD enum"]
19214 pub param2: f32,
19215 #[doc = "PARAM3, see MAV_CMD enum"]
19216 pub param3: f32,
19217 #[doc = "PARAM4, see MAV_CMD enum"]
19218 pub param4: f32,
19219 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19220 pub x: i32,
19221 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19222 pub y: i32,
19223 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19224 pub z: f32,
19225 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19226 pub seq: u16,
19227 #[doc = "The scheduled action for the waypoint."]
19228 pub command: MavCmd,
19229 #[doc = "System ID"]
19230 pub target_system: u8,
19231 #[doc = "Component ID"]
19232 pub target_component: u8,
19233 #[doc = "The coordinate system of the waypoint."]
19234 pub frame: MavFrame,
19235 #[doc = "false:0, true:1"]
19236 pub current: u8,
19237 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19238 pub autocontinue: u8,
19239 #[doc = "Mission type."]
19240 #[cfg_attr(feature = "serde", serde(default))]
19241 pub mission_type: MavMissionType,
19242}
19243impl MISSION_ITEM_INT_DATA {
19244 pub const ENCODED_LEN: usize = 38usize;
19245 pub const DEFAULT: Self = Self {
19246 param1: 0.0_f32,
19247 param2: 0.0_f32,
19248 param3: 0.0_f32,
19249 param4: 0.0_f32,
19250 x: 0_i32,
19251 y: 0_i32,
19252 z: 0.0_f32,
19253 seq: 0_u16,
19254 command: MavCmd::DEFAULT,
19255 target_system: 0_u8,
19256 target_component: 0_u8,
19257 frame: MavFrame::DEFAULT,
19258 current: 0_u8,
19259 autocontinue: 0_u8,
19260 mission_type: MavMissionType::DEFAULT,
19261 };
19262 #[cfg(feature = "arbitrary")]
19263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19264 use arbitrary::{Arbitrary, Unstructured};
19265 let mut buf = [0u8; 1024];
19266 rng.fill_bytes(&mut buf);
19267 let mut unstructured = Unstructured::new(&buf);
19268 Self::arbitrary(&mut unstructured).unwrap_or_default()
19269 }
19270}
19271impl Default for MISSION_ITEM_INT_DATA {
19272 fn default() -> Self {
19273 Self::DEFAULT.clone()
19274 }
19275}
19276impl MessageData for MISSION_ITEM_INT_DATA {
19277 type Message = MavMessage;
19278 const ID: u32 = 73u32;
19279 const NAME: &'static str = "MISSION_ITEM_INT";
19280 const EXTRA_CRC: u8 = 38u8;
19281 const ENCODED_LEN: usize = 38usize;
19282 fn deser(
19283 _version: MavlinkVersion,
19284 __input: &[u8],
19285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19286 let avail_len = __input.len();
19287 let mut payload_buf = [0; Self::ENCODED_LEN];
19288 let mut buf = if avail_len < Self::ENCODED_LEN {
19289 payload_buf[0..avail_len].copy_from_slice(__input);
19290 Bytes::new(&payload_buf)
19291 } else {
19292 Bytes::new(__input)
19293 };
19294 let mut __struct = Self::default();
19295 __struct.param1 = buf.get_f32_le();
19296 __struct.param2 = buf.get_f32_le();
19297 __struct.param3 = buf.get_f32_le();
19298 __struct.param4 = buf.get_f32_le();
19299 __struct.x = buf.get_i32_le();
19300 __struct.y = buf.get_i32_le();
19301 __struct.z = buf.get_f32_le();
19302 __struct.seq = buf.get_u16_le();
19303 let tmp = buf.get_u16_le();
19304 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19305 ::mavlink_core::error::ParserError::InvalidEnum {
19306 enum_type: "MavCmd",
19307 value: tmp as u32,
19308 },
19309 )?;
19310 __struct.target_system = buf.get_u8();
19311 __struct.target_component = buf.get_u8();
19312 let tmp = buf.get_u8();
19313 __struct.frame =
19314 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19315 enum_type: "MavFrame",
19316 value: tmp as u32,
19317 })?;
19318 __struct.current = buf.get_u8();
19319 __struct.autocontinue = buf.get_u8();
19320 let tmp = buf.get_u8();
19321 __struct.mission_type =
19322 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19323 enum_type: "MavMissionType",
19324 value: tmp as u32,
19325 })?;
19326 Ok(__struct)
19327 }
19328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19329 let mut __tmp = BytesMut::new(bytes);
19330 #[allow(clippy::absurd_extreme_comparisons)]
19331 #[allow(unused_comparisons)]
19332 if __tmp.remaining() < Self::ENCODED_LEN {
19333 panic!(
19334 "buffer is too small (need {} bytes, but got {})",
19335 Self::ENCODED_LEN,
19336 __tmp.remaining(),
19337 )
19338 }
19339 __tmp.put_f32_le(self.param1);
19340 __tmp.put_f32_le(self.param2);
19341 __tmp.put_f32_le(self.param3);
19342 __tmp.put_f32_le(self.param4);
19343 __tmp.put_i32_le(self.x);
19344 __tmp.put_i32_le(self.y);
19345 __tmp.put_f32_le(self.z);
19346 __tmp.put_u16_le(self.seq);
19347 __tmp.put_u16_le(self.command as u16);
19348 __tmp.put_u8(self.target_system);
19349 __tmp.put_u8(self.target_component);
19350 __tmp.put_u8(self.frame as u8);
19351 __tmp.put_u8(self.current);
19352 __tmp.put_u8(self.autocontinue);
19353 __tmp.put_u8(self.mission_type as u8);
19354 if matches!(version, MavlinkVersion::V2) {
19355 let len = __tmp.len();
19356 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19357 } else {
19358 __tmp.len()
19359 }
19360 }
19361}
19362#[doc = "id: 46"]
19363#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19364#[derive(Debug, Clone, PartialEq)]
19365#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19366#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19367pub struct MISSION_ITEM_REACHED_DATA {
19368 #[doc = "Sequence"]
19369 pub seq: u16,
19370}
19371impl MISSION_ITEM_REACHED_DATA {
19372 pub const ENCODED_LEN: usize = 2usize;
19373 pub const DEFAULT: Self = Self { seq: 0_u16 };
19374 #[cfg(feature = "arbitrary")]
19375 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19376 use arbitrary::{Arbitrary, Unstructured};
19377 let mut buf = [0u8; 1024];
19378 rng.fill_bytes(&mut buf);
19379 let mut unstructured = Unstructured::new(&buf);
19380 Self::arbitrary(&mut unstructured).unwrap_or_default()
19381 }
19382}
19383impl Default for MISSION_ITEM_REACHED_DATA {
19384 fn default() -> Self {
19385 Self::DEFAULT.clone()
19386 }
19387}
19388impl MessageData for MISSION_ITEM_REACHED_DATA {
19389 type Message = MavMessage;
19390 const ID: u32 = 46u32;
19391 const NAME: &'static str = "MISSION_ITEM_REACHED";
19392 const EXTRA_CRC: u8 = 11u8;
19393 const ENCODED_LEN: usize = 2usize;
19394 fn deser(
19395 _version: MavlinkVersion,
19396 __input: &[u8],
19397 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19398 let avail_len = __input.len();
19399 let mut payload_buf = [0; Self::ENCODED_LEN];
19400 let mut buf = if avail_len < Self::ENCODED_LEN {
19401 payload_buf[0..avail_len].copy_from_slice(__input);
19402 Bytes::new(&payload_buf)
19403 } else {
19404 Bytes::new(__input)
19405 };
19406 let mut __struct = Self::default();
19407 __struct.seq = buf.get_u16_le();
19408 Ok(__struct)
19409 }
19410 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19411 let mut __tmp = BytesMut::new(bytes);
19412 #[allow(clippy::absurd_extreme_comparisons)]
19413 #[allow(unused_comparisons)]
19414 if __tmp.remaining() < Self::ENCODED_LEN {
19415 panic!(
19416 "buffer is too small (need {} bytes, but got {})",
19417 Self::ENCODED_LEN,
19418 __tmp.remaining(),
19419 )
19420 }
19421 __tmp.put_u16_le(self.seq);
19422 if matches!(version, MavlinkVersion::V2) {
19423 let len = __tmp.len();
19424 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19425 } else {
19426 __tmp.len()
19427 }
19428 }
19429}
19430#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19431#[doc = "id: 40"]
19432#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19433#[derive(Debug, Clone, PartialEq)]
19434#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19435#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19436pub struct MISSION_REQUEST_DATA {
19437 #[doc = "Sequence"]
19438 pub seq: u16,
19439 #[doc = "System ID"]
19440 pub target_system: u8,
19441 #[doc = "Component ID"]
19442 pub target_component: u8,
19443 #[doc = "Mission type."]
19444 #[cfg_attr(feature = "serde", serde(default))]
19445 pub mission_type: MavMissionType,
19446}
19447impl MISSION_REQUEST_DATA {
19448 pub const ENCODED_LEN: usize = 5usize;
19449 pub const DEFAULT: Self = Self {
19450 seq: 0_u16,
19451 target_system: 0_u8,
19452 target_component: 0_u8,
19453 mission_type: MavMissionType::DEFAULT,
19454 };
19455 #[cfg(feature = "arbitrary")]
19456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19457 use arbitrary::{Arbitrary, Unstructured};
19458 let mut buf = [0u8; 1024];
19459 rng.fill_bytes(&mut buf);
19460 let mut unstructured = Unstructured::new(&buf);
19461 Self::arbitrary(&mut unstructured).unwrap_or_default()
19462 }
19463}
19464impl Default for MISSION_REQUEST_DATA {
19465 fn default() -> Self {
19466 Self::DEFAULT.clone()
19467 }
19468}
19469impl MessageData for MISSION_REQUEST_DATA {
19470 type Message = MavMessage;
19471 const ID: u32 = 40u32;
19472 const NAME: &'static str = "MISSION_REQUEST";
19473 const EXTRA_CRC: u8 = 230u8;
19474 const ENCODED_LEN: usize = 5usize;
19475 fn deser(
19476 _version: MavlinkVersion,
19477 __input: &[u8],
19478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19479 let avail_len = __input.len();
19480 let mut payload_buf = [0; Self::ENCODED_LEN];
19481 let mut buf = if avail_len < Self::ENCODED_LEN {
19482 payload_buf[0..avail_len].copy_from_slice(__input);
19483 Bytes::new(&payload_buf)
19484 } else {
19485 Bytes::new(__input)
19486 };
19487 let mut __struct = Self::default();
19488 __struct.seq = buf.get_u16_le();
19489 __struct.target_system = buf.get_u8();
19490 __struct.target_component = buf.get_u8();
19491 let tmp = buf.get_u8();
19492 __struct.mission_type =
19493 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19494 enum_type: "MavMissionType",
19495 value: tmp as u32,
19496 })?;
19497 Ok(__struct)
19498 }
19499 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19500 let mut __tmp = BytesMut::new(bytes);
19501 #[allow(clippy::absurd_extreme_comparisons)]
19502 #[allow(unused_comparisons)]
19503 if __tmp.remaining() < Self::ENCODED_LEN {
19504 panic!(
19505 "buffer is too small (need {} bytes, but got {})",
19506 Self::ENCODED_LEN,
19507 __tmp.remaining(),
19508 )
19509 }
19510 __tmp.put_u16_le(self.seq);
19511 __tmp.put_u8(self.target_system);
19512 __tmp.put_u8(self.target_component);
19513 __tmp.put_u8(self.mission_type as u8);
19514 if matches!(version, MavlinkVersion::V2) {
19515 let len = __tmp.len();
19516 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19517 } else {
19518 __tmp.len()
19519 }
19520 }
19521}
19522#[doc = "id: 51"]
19523#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19524#[derive(Debug, Clone, PartialEq)]
19525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19527pub struct MISSION_REQUEST_INT_DATA {
19528 #[doc = "Sequence"]
19529 pub seq: u16,
19530 #[doc = "System ID"]
19531 pub target_system: u8,
19532 #[doc = "Component ID"]
19533 pub target_component: u8,
19534 #[doc = "Mission type."]
19535 #[cfg_attr(feature = "serde", serde(default))]
19536 pub mission_type: MavMissionType,
19537}
19538impl MISSION_REQUEST_INT_DATA {
19539 pub const ENCODED_LEN: usize = 5usize;
19540 pub const DEFAULT: Self = Self {
19541 seq: 0_u16,
19542 target_system: 0_u8,
19543 target_component: 0_u8,
19544 mission_type: MavMissionType::DEFAULT,
19545 };
19546 #[cfg(feature = "arbitrary")]
19547 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19548 use arbitrary::{Arbitrary, Unstructured};
19549 let mut buf = [0u8; 1024];
19550 rng.fill_bytes(&mut buf);
19551 let mut unstructured = Unstructured::new(&buf);
19552 Self::arbitrary(&mut unstructured).unwrap_or_default()
19553 }
19554}
19555impl Default for MISSION_REQUEST_INT_DATA {
19556 fn default() -> Self {
19557 Self::DEFAULT.clone()
19558 }
19559}
19560impl MessageData for MISSION_REQUEST_INT_DATA {
19561 type Message = MavMessage;
19562 const ID: u32 = 51u32;
19563 const NAME: &'static str = "MISSION_REQUEST_INT";
19564 const EXTRA_CRC: u8 = 196u8;
19565 const ENCODED_LEN: usize = 5usize;
19566 fn deser(
19567 _version: MavlinkVersion,
19568 __input: &[u8],
19569 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19570 let avail_len = __input.len();
19571 let mut payload_buf = [0; Self::ENCODED_LEN];
19572 let mut buf = if avail_len < Self::ENCODED_LEN {
19573 payload_buf[0..avail_len].copy_from_slice(__input);
19574 Bytes::new(&payload_buf)
19575 } else {
19576 Bytes::new(__input)
19577 };
19578 let mut __struct = Self::default();
19579 __struct.seq = buf.get_u16_le();
19580 __struct.target_system = buf.get_u8();
19581 __struct.target_component = buf.get_u8();
19582 let tmp = buf.get_u8();
19583 __struct.mission_type =
19584 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19585 enum_type: "MavMissionType",
19586 value: tmp as u32,
19587 })?;
19588 Ok(__struct)
19589 }
19590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19591 let mut __tmp = BytesMut::new(bytes);
19592 #[allow(clippy::absurd_extreme_comparisons)]
19593 #[allow(unused_comparisons)]
19594 if __tmp.remaining() < Self::ENCODED_LEN {
19595 panic!(
19596 "buffer is too small (need {} bytes, but got {})",
19597 Self::ENCODED_LEN,
19598 __tmp.remaining(),
19599 )
19600 }
19601 __tmp.put_u16_le(self.seq);
19602 __tmp.put_u8(self.target_system);
19603 __tmp.put_u8(self.target_component);
19604 __tmp.put_u8(self.mission_type as u8);
19605 if matches!(version, MavlinkVersion::V2) {
19606 let len = __tmp.len();
19607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19608 } else {
19609 __tmp.len()
19610 }
19611 }
19612}
19613#[doc = "id: 43"]
19614#[doc = "Request the overall list of mission items from the system/component."]
19615#[derive(Debug, Clone, PartialEq)]
19616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19618pub struct MISSION_REQUEST_LIST_DATA {
19619 #[doc = "System ID"]
19620 pub target_system: u8,
19621 #[doc = "Component ID"]
19622 pub target_component: u8,
19623 #[doc = "Mission type."]
19624 #[cfg_attr(feature = "serde", serde(default))]
19625 pub mission_type: MavMissionType,
19626}
19627impl MISSION_REQUEST_LIST_DATA {
19628 pub const ENCODED_LEN: usize = 3usize;
19629 pub const DEFAULT: Self = Self {
19630 target_system: 0_u8,
19631 target_component: 0_u8,
19632 mission_type: MavMissionType::DEFAULT,
19633 };
19634 #[cfg(feature = "arbitrary")]
19635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19636 use arbitrary::{Arbitrary, Unstructured};
19637 let mut buf = [0u8; 1024];
19638 rng.fill_bytes(&mut buf);
19639 let mut unstructured = Unstructured::new(&buf);
19640 Self::arbitrary(&mut unstructured).unwrap_or_default()
19641 }
19642}
19643impl Default for MISSION_REQUEST_LIST_DATA {
19644 fn default() -> Self {
19645 Self::DEFAULT.clone()
19646 }
19647}
19648impl MessageData for MISSION_REQUEST_LIST_DATA {
19649 type Message = MavMessage;
19650 const ID: u32 = 43u32;
19651 const NAME: &'static str = "MISSION_REQUEST_LIST";
19652 const EXTRA_CRC: u8 = 132u8;
19653 const ENCODED_LEN: usize = 3usize;
19654 fn deser(
19655 _version: MavlinkVersion,
19656 __input: &[u8],
19657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19658 let avail_len = __input.len();
19659 let mut payload_buf = [0; Self::ENCODED_LEN];
19660 let mut buf = if avail_len < Self::ENCODED_LEN {
19661 payload_buf[0..avail_len].copy_from_slice(__input);
19662 Bytes::new(&payload_buf)
19663 } else {
19664 Bytes::new(__input)
19665 };
19666 let mut __struct = Self::default();
19667 __struct.target_system = buf.get_u8();
19668 __struct.target_component = buf.get_u8();
19669 let tmp = buf.get_u8();
19670 __struct.mission_type =
19671 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19672 enum_type: "MavMissionType",
19673 value: tmp as u32,
19674 })?;
19675 Ok(__struct)
19676 }
19677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19678 let mut __tmp = BytesMut::new(bytes);
19679 #[allow(clippy::absurd_extreme_comparisons)]
19680 #[allow(unused_comparisons)]
19681 if __tmp.remaining() < Self::ENCODED_LEN {
19682 panic!(
19683 "buffer is too small (need {} bytes, but got {})",
19684 Self::ENCODED_LEN,
19685 __tmp.remaining(),
19686 )
19687 }
19688 __tmp.put_u8(self.target_system);
19689 __tmp.put_u8(self.target_component);
19690 __tmp.put_u8(self.mission_type as u8);
19691 if matches!(version, MavlinkVersion::V2) {
19692 let len = __tmp.len();
19693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19694 } else {
19695 __tmp.len()
19696 }
19697 }
19698}
19699#[doc = "id: 37"]
19700#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
19701#[derive(Debug, Clone, PartialEq)]
19702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19704pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
19705 #[doc = "Start index"]
19706 pub start_index: i16,
19707 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
19708 pub end_index: i16,
19709 #[doc = "System ID"]
19710 pub target_system: u8,
19711 #[doc = "Component ID"]
19712 pub target_component: u8,
19713 #[doc = "Mission type."]
19714 #[cfg_attr(feature = "serde", serde(default))]
19715 pub mission_type: MavMissionType,
19716}
19717impl MISSION_REQUEST_PARTIAL_LIST_DATA {
19718 pub const ENCODED_LEN: usize = 7usize;
19719 pub const DEFAULT: Self = Self {
19720 start_index: 0_i16,
19721 end_index: 0_i16,
19722 target_system: 0_u8,
19723 target_component: 0_u8,
19724 mission_type: MavMissionType::DEFAULT,
19725 };
19726 #[cfg(feature = "arbitrary")]
19727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19728 use arbitrary::{Arbitrary, Unstructured};
19729 let mut buf = [0u8; 1024];
19730 rng.fill_bytes(&mut buf);
19731 let mut unstructured = Unstructured::new(&buf);
19732 Self::arbitrary(&mut unstructured).unwrap_or_default()
19733 }
19734}
19735impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
19736 fn default() -> Self {
19737 Self::DEFAULT.clone()
19738 }
19739}
19740impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
19741 type Message = MavMessage;
19742 const ID: u32 = 37u32;
19743 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
19744 const EXTRA_CRC: u8 = 212u8;
19745 const ENCODED_LEN: usize = 7usize;
19746 fn deser(
19747 _version: MavlinkVersion,
19748 __input: &[u8],
19749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19750 let avail_len = __input.len();
19751 let mut payload_buf = [0; Self::ENCODED_LEN];
19752 let mut buf = if avail_len < Self::ENCODED_LEN {
19753 payload_buf[0..avail_len].copy_from_slice(__input);
19754 Bytes::new(&payload_buf)
19755 } else {
19756 Bytes::new(__input)
19757 };
19758 let mut __struct = Self::default();
19759 __struct.start_index = buf.get_i16_le();
19760 __struct.end_index = buf.get_i16_le();
19761 __struct.target_system = buf.get_u8();
19762 __struct.target_component = buf.get_u8();
19763 let tmp = buf.get_u8();
19764 __struct.mission_type =
19765 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19766 enum_type: "MavMissionType",
19767 value: tmp as u32,
19768 })?;
19769 Ok(__struct)
19770 }
19771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19772 let mut __tmp = BytesMut::new(bytes);
19773 #[allow(clippy::absurd_extreme_comparisons)]
19774 #[allow(unused_comparisons)]
19775 if __tmp.remaining() < Self::ENCODED_LEN {
19776 panic!(
19777 "buffer is too small (need {} bytes, but got {})",
19778 Self::ENCODED_LEN,
19779 __tmp.remaining(),
19780 )
19781 }
19782 __tmp.put_i16_le(self.start_index);
19783 __tmp.put_i16_le(self.end_index);
19784 __tmp.put_u8(self.target_system);
19785 __tmp.put_u8(self.target_component);
19786 __tmp.put_u8(self.mission_type as u8);
19787 if matches!(version, MavlinkVersion::V2) {
19788 let len = __tmp.len();
19789 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19790 } else {
19791 __tmp.len()
19792 }
19793 }
19794}
19795#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
19796#[doc = "id: 41"]
19797#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
19798#[derive(Debug, Clone, PartialEq)]
19799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19801pub struct MISSION_SET_CURRENT_DATA {
19802 #[doc = "Sequence"]
19803 pub seq: u16,
19804 #[doc = "System ID"]
19805 pub target_system: u8,
19806 #[doc = "Component ID"]
19807 pub target_component: u8,
19808}
19809impl MISSION_SET_CURRENT_DATA {
19810 pub const ENCODED_LEN: usize = 4usize;
19811 pub const DEFAULT: Self = Self {
19812 seq: 0_u16,
19813 target_system: 0_u8,
19814 target_component: 0_u8,
19815 };
19816 #[cfg(feature = "arbitrary")]
19817 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19818 use arbitrary::{Arbitrary, Unstructured};
19819 let mut buf = [0u8; 1024];
19820 rng.fill_bytes(&mut buf);
19821 let mut unstructured = Unstructured::new(&buf);
19822 Self::arbitrary(&mut unstructured).unwrap_or_default()
19823 }
19824}
19825impl Default for MISSION_SET_CURRENT_DATA {
19826 fn default() -> Self {
19827 Self::DEFAULT.clone()
19828 }
19829}
19830impl MessageData for MISSION_SET_CURRENT_DATA {
19831 type Message = MavMessage;
19832 const ID: u32 = 41u32;
19833 const NAME: &'static str = "MISSION_SET_CURRENT";
19834 const EXTRA_CRC: u8 = 28u8;
19835 const ENCODED_LEN: usize = 4usize;
19836 fn deser(
19837 _version: MavlinkVersion,
19838 __input: &[u8],
19839 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19840 let avail_len = __input.len();
19841 let mut payload_buf = [0; Self::ENCODED_LEN];
19842 let mut buf = if avail_len < Self::ENCODED_LEN {
19843 payload_buf[0..avail_len].copy_from_slice(__input);
19844 Bytes::new(&payload_buf)
19845 } else {
19846 Bytes::new(__input)
19847 };
19848 let mut __struct = Self::default();
19849 __struct.seq = buf.get_u16_le();
19850 __struct.target_system = buf.get_u8();
19851 __struct.target_component = buf.get_u8();
19852 Ok(__struct)
19853 }
19854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19855 let mut __tmp = BytesMut::new(bytes);
19856 #[allow(clippy::absurd_extreme_comparisons)]
19857 #[allow(unused_comparisons)]
19858 if __tmp.remaining() < Self::ENCODED_LEN {
19859 panic!(
19860 "buffer is too small (need {} bytes, but got {})",
19861 Self::ENCODED_LEN,
19862 __tmp.remaining(),
19863 )
19864 }
19865 __tmp.put_u16_le(self.seq);
19866 __tmp.put_u8(self.target_system);
19867 __tmp.put_u8(self.target_component);
19868 if matches!(version, MavlinkVersion::V2) {
19869 let len = __tmp.len();
19870 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19871 } else {
19872 __tmp.len()
19873 }
19874 }
19875}
19876#[doc = "id: 38"]
19877#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
19878#[derive(Debug, Clone, PartialEq)]
19879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19881pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
19882 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
19883 pub start_index: i16,
19884 #[doc = "End index, equal or greater than start index."]
19885 pub end_index: i16,
19886 #[doc = "System ID"]
19887 pub target_system: u8,
19888 #[doc = "Component ID"]
19889 pub target_component: u8,
19890 #[doc = "Mission type."]
19891 #[cfg_attr(feature = "serde", serde(default))]
19892 pub mission_type: MavMissionType,
19893}
19894impl MISSION_WRITE_PARTIAL_LIST_DATA {
19895 pub const ENCODED_LEN: usize = 7usize;
19896 pub const DEFAULT: Self = Self {
19897 start_index: 0_i16,
19898 end_index: 0_i16,
19899 target_system: 0_u8,
19900 target_component: 0_u8,
19901 mission_type: MavMissionType::DEFAULT,
19902 };
19903 #[cfg(feature = "arbitrary")]
19904 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19905 use arbitrary::{Arbitrary, Unstructured};
19906 let mut buf = [0u8; 1024];
19907 rng.fill_bytes(&mut buf);
19908 let mut unstructured = Unstructured::new(&buf);
19909 Self::arbitrary(&mut unstructured).unwrap_or_default()
19910 }
19911}
19912impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
19913 fn default() -> Self {
19914 Self::DEFAULT.clone()
19915 }
19916}
19917impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
19918 type Message = MavMessage;
19919 const ID: u32 = 38u32;
19920 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
19921 const EXTRA_CRC: u8 = 9u8;
19922 const ENCODED_LEN: usize = 7usize;
19923 fn deser(
19924 _version: MavlinkVersion,
19925 __input: &[u8],
19926 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19927 let avail_len = __input.len();
19928 let mut payload_buf = [0; Self::ENCODED_LEN];
19929 let mut buf = if avail_len < Self::ENCODED_LEN {
19930 payload_buf[0..avail_len].copy_from_slice(__input);
19931 Bytes::new(&payload_buf)
19932 } else {
19933 Bytes::new(__input)
19934 };
19935 let mut __struct = Self::default();
19936 __struct.start_index = buf.get_i16_le();
19937 __struct.end_index = buf.get_i16_le();
19938 __struct.target_system = buf.get_u8();
19939 __struct.target_component = buf.get_u8();
19940 let tmp = buf.get_u8();
19941 __struct.mission_type =
19942 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19943 enum_type: "MavMissionType",
19944 value: tmp as u32,
19945 })?;
19946 Ok(__struct)
19947 }
19948 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19949 let mut __tmp = BytesMut::new(bytes);
19950 #[allow(clippy::absurd_extreme_comparisons)]
19951 #[allow(unused_comparisons)]
19952 if __tmp.remaining() < Self::ENCODED_LEN {
19953 panic!(
19954 "buffer is too small (need {} bytes, but got {})",
19955 Self::ENCODED_LEN,
19956 __tmp.remaining(),
19957 )
19958 }
19959 __tmp.put_i16_le(self.start_index);
19960 __tmp.put_i16_le(self.end_index);
19961 __tmp.put_u8(self.target_system);
19962 __tmp.put_u8(self.target_component);
19963 __tmp.put_u8(self.mission_type as u8);
19964 if matches!(version, MavlinkVersion::V2) {
19965 let len = __tmp.len();
19966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19967 } else {
19968 __tmp.len()
19969 }
19970 }
19971}
19972#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
19973#[doc = "id: 265"]
19974#[doc = "Orientation of a mount."]
19975#[derive(Debug, Clone, PartialEq)]
19976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19978pub struct MOUNT_ORIENTATION_DATA {
19979 #[doc = "Timestamp (time since system boot)."]
19980 pub time_boot_ms: u32,
19981 #[doc = "Roll in global frame (set to NaN for invalid)."]
19982 pub roll: f32,
19983 #[doc = "Pitch in global frame (set to NaN for invalid)."]
19984 pub pitch: f32,
19985 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
19986 pub yaw: f32,
19987 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
19988 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19989 pub yaw_absolute: f32,
19990}
19991impl MOUNT_ORIENTATION_DATA {
19992 pub const ENCODED_LEN: usize = 20usize;
19993 pub const DEFAULT: Self = Self {
19994 time_boot_ms: 0_u32,
19995 roll: 0.0_f32,
19996 pitch: 0.0_f32,
19997 yaw: 0.0_f32,
19998 yaw_absolute: 0.0_f32,
19999 };
20000 #[cfg(feature = "arbitrary")]
20001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20002 use arbitrary::{Arbitrary, Unstructured};
20003 let mut buf = [0u8; 1024];
20004 rng.fill_bytes(&mut buf);
20005 let mut unstructured = Unstructured::new(&buf);
20006 Self::arbitrary(&mut unstructured).unwrap_or_default()
20007 }
20008}
20009impl Default for MOUNT_ORIENTATION_DATA {
20010 fn default() -> Self {
20011 Self::DEFAULT.clone()
20012 }
20013}
20014impl MessageData for MOUNT_ORIENTATION_DATA {
20015 type Message = MavMessage;
20016 const ID: u32 = 265u32;
20017 const NAME: &'static str = "MOUNT_ORIENTATION";
20018 const EXTRA_CRC: u8 = 26u8;
20019 const ENCODED_LEN: usize = 20usize;
20020 fn deser(
20021 _version: MavlinkVersion,
20022 __input: &[u8],
20023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20024 let avail_len = __input.len();
20025 let mut payload_buf = [0; Self::ENCODED_LEN];
20026 let mut buf = if avail_len < Self::ENCODED_LEN {
20027 payload_buf[0..avail_len].copy_from_slice(__input);
20028 Bytes::new(&payload_buf)
20029 } else {
20030 Bytes::new(__input)
20031 };
20032 let mut __struct = Self::default();
20033 __struct.time_boot_ms = buf.get_u32_le();
20034 __struct.roll = buf.get_f32_le();
20035 __struct.pitch = buf.get_f32_le();
20036 __struct.yaw = buf.get_f32_le();
20037 __struct.yaw_absolute = buf.get_f32_le();
20038 Ok(__struct)
20039 }
20040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20041 let mut __tmp = BytesMut::new(bytes);
20042 #[allow(clippy::absurd_extreme_comparisons)]
20043 #[allow(unused_comparisons)]
20044 if __tmp.remaining() < Self::ENCODED_LEN {
20045 panic!(
20046 "buffer is too small (need {} bytes, but got {})",
20047 Self::ENCODED_LEN,
20048 __tmp.remaining(),
20049 )
20050 }
20051 __tmp.put_u32_le(self.time_boot_ms);
20052 __tmp.put_f32_le(self.roll);
20053 __tmp.put_f32_le(self.pitch);
20054 __tmp.put_f32_le(self.yaw);
20055 __tmp.put_f32_le(self.yaw_absolute);
20056 if matches!(version, MavlinkVersion::V2) {
20057 let len = __tmp.len();
20058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20059 } else {
20060 __tmp.len()
20061 }
20062 }
20063}
20064#[doc = "id: 251"]
20065#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20066#[derive(Debug, Clone, PartialEq)]
20067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20069pub struct NAMED_VALUE_FLOAT_DATA {
20070 #[doc = "Timestamp (time since system boot)."]
20071 pub time_boot_ms: u32,
20072 #[doc = "Floating point value"]
20073 pub value: f32,
20074 #[doc = "Name of the debug variable"]
20075 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20076 pub name: [u8; 10],
20077}
20078impl NAMED_VALUE_FLOAT_DATA {
20079 pub const ENCODED_LEN: usize = 18usize;
20080 pub const DEFAULT: Self = Self {
20081 time_boot_ms: 0_u32,
20082 value: 0.0_f32,
20083 name: [0_u8; 10usize],
20084 };
20085 #[cfg(feature = "arbitrary")]
20086 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20087 use arbitrary::{Arbitrary, Unstructured};
20088 let mut buf = [0u8; 1024];
20089 rng.fill_bytes(&mut buf);
20090 let mut unstructured = Unstructured::new(&buf);
20091 Self::arbitrary(&mut unstructured).unwrap_or_default()
20092 }
20093}
20094impl Default for NAMED_VALUE_FLOAT_DATA {
20095 fn default() -> Self {
20096 Self::DEFAULT.clone()
20097 }
20098}
20099impl MessageData for NAMED_VALUE_FLOAT_DATA {
20100 type Message = MavMessage;
20101 const ID: u32 = 251u32;
20102 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20103 const EXTRA_CRC: u8 = 170u8;
20104 const ENCODED_LEN: usize = 18usize;
20105 fn deser(
20106 _version: MavlinkVersion,
20107 __input: &[u8],
20108 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20109 let avail_len = __input.len();
20110 let mut payload_buf = [0; Self::ENCODED_LEN];
20111 let mut buf = if avail_len < Self::ENCODED_LEN {
20112 payload_buf[0..avail_len].copy_from_slice(__input);
20113 Bytes::new(&payload_buf)
20114 } else {
20115 Bytes::new(__input)
20116 };
20117 let mut __struct = Self::default();
20118 __struct.time_boot_ms = buf.get_u32_le();
20119 __struct.value = buf.get_f32_le();
20120 for v in &mut __struct.name {
20121 let val = buf.get_u8();
20122 *v = val;
20123 }
20124 Ok(__struct)
20125 }
20126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20127 let mut __tmp = BytesMut::new(bytes);
20128 #[allow(clippy::absurd_extreme_comparisons)]
20129 #[allow(unused_comparisons)]
20130 if __tmp.remaining() < Self::ENCODED_LEN {
20131 panic!(
20132 "buffer is too small (need {} bytes, but got {})",
20133 Self::ENCODED_LEN,
20134 __tmp.remaining(),
20135 )
20136 }
20137 __tmp.put_u32_le(self.time_boot_ms);
20138 __tmp.put_f32_le(self.value);
20139 for val in &self.name {
20140 __tmp.put_u8(*val);
20141 }
20142 if matches!(version, MavlinkVersion::V2) {
20143 let len = __tmp.len();
20144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20145 } else {
20146 __tmp.len()
20147 }
20148 }
20149}
20150#[doc = "id: 252"]
20151#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20152#[derive(Debug, Clone, PartialEq)]
20153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20155pub struct NAMED_VALUE_INT_DATA {
20156 #[doc = "Timestamp (time since system boot)."]
20157 pub time_boot_ms: u32,
20158 #[doc = "Signed integer value"]
20159 pub value: i32,
20160 #[doc = "Name of the debug variable"]
20161 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20162 pub name: [u8; 10],
20163}
20164impl NAMED_VALUE_INT_DATA {
20165 pub const ENCODED_LEN: usize = 18usize;
20166 pub const DEFAULT: Self = Self {
20167 time_boot_ms: 0_u32,
20168 value: 0_i32,
20169 name: [0_u8; 10usize],
20170 };
20171 #[cfg(feature = "arbitrary")]
20172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20173 use arbitrary::{Arbitrary, Unstructured};
20174 let mut buf = [0u8; 1024];
20175 rng.fill_bytes(&mut buf);
20176 let mut unstructured = Unstructured::new(&buf);
20177 Self::arbitrary(&mut unstructured).unwrap_or_default()
20178 }
20179}
20180impl Default for NAMED_VALUE_INT_DATA {
20181 fn default() -> Self {
20182 Self::DEFAULT.clone()
20183 }
20184}
20185impl MessageData for NAMED_VALUE_INT_DATA {
20186 type Message = MavMessage;
20187 const ID: u32 = 252u32;
20188 const NAME: &'static str = "NAMED_VALUE_INT";
20189 const EXTRA_CRC: u8 = 44u8;
20190 const ENCODED_LEN: usize = 18usize;
20191 fn deser(
20192 _version: MavlinkVersion,
20193 __input: &[u8],
20194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20195 let avail_len = __input.len();
20196 let mut payload_buf = [0; Self::ENCODED_LEN];
20197 let mut buf = if avail_len < Self::ENCODED_LEN {
20198 payload_buf[0..avail_len].copy_from_slice(__input);
20199 Bytes::new(&payload_buf)
20200 } else {
20201 Bytes::new(__input)
20202 };
20203 let mut __struct = Self::default();
20204 __struct.time_boot_ms = buf.get_u32_le();
20205 __struct.value = buf.get_i32_le();
20206 for v in &mut __struct.name {
20207 let val = buf.get_u8();
20208 *v = val;
20209 }
20210 Ok(__struct)
20211 }
20212 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20213 let mut __tmp = BytesMut::new(bytes);
20214 #[allow(clippy::absurd_extreme_comparisons)]
20215 #[allow(unused_comparisons)]
20216 if __tmp.remaining() < Self::ENCODED_LEN {
20217 panic!(
20218 "buffer is too small (need {} bytes, but got {})",
20219 Self::ENCODED_LEN,
20220 __tmp.remaining(),
20221 )
20222 }
20223 __tmp.put_u32_le(self.time_boot_ms);
20224 __tmp.put_i32_le(self.value);
20225 for val in &self.name {
20226 __tmp.put_u8(*val);
20227 }
20228 if matches!(version, MavlinkVersion::V2) {
20229 let len = __tmp.len();
20230 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20231 } else {
20232 __tmp.len()
20233 }
20234 }
20235}
20236#[doc = "id: 62"]
20237#[doc = "The state of the navigation and position controller."]
20238#[derive(Debug, Clone, PartialEq)]
20239#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20240#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20241pub struct NAV_CONTROLLER_OUTPUT_DATA {
20242 #[doc = "Current desired roll"]
20243 pub nav_roll: f32,
20244 #[doc = "Current desired pitch"]
20245 pub nav_pitch: f32,
20246 #[doc = "Current altitude error"]
20247 pub alt_error: f32,
20248 #[doc = "Current airspeed error"]
20249 pub aspd_error: f32,
20250 #[doc = "Current crosstrack error on x-y plane"]
20251 pub xtrack_error: f32,
20252 #[doc = "Current desired heading"]
20253 pub nav_bearing: i16,
20254 #[doc = "Bearing to current waypoint/target"]
20255 pub target_bearing: i16,
20256 #[doc = "Distance to active waypoint"]
20257 pub wp_dist: u16,
20258}
20259impl NAV_CONTROLLER_OUTPUT_DATA {
20260 pub const ENCODED_LEN: usize = 26usize;
20261 pub const DEFAULT: Self = Self {
20262 nav_roll: 0.0_f32,
20263 nav_pitch: 0.0_f32,
20264 alt_error: 0.0_f32,
20265 aspd_error: 0.0_f32,
20266 xtrack_error: 0.0_f32,
20267 nav_bearing: 0_i16,
20268 target_bearing: 0_i16,
20269 wp_dist: 0_u16,
20270 };
20271 #[cfg(feature = "arbitrary")]
20272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20273 use arbitrary::{Arbitrary, Unstructured};
20274 let mut buf = [0u8; 1024];
20275 rng.fill_bytes(&mut buf);
20276 let mut unstructured = Unstructured::new(&buf);
20277 Self::arbitrary(&mut unstructured).unwrap_or_default()
20278 }
20279}
20280impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20281 fn default() -> Self {
20282 Self::DEFAULT.clone()
20283 }
20284}
20285impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20286 type Message = MavMessage;
20287 const ID: u32 = 62u32;
20288 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20289 const EXTRA_CRC: u8 = 183u8;
20290 const ENCODED_LEN: usize = 26usize;
20291 fn deser(
20292 _version: MavlinkVersion,
20293 __input: &[u8],
20294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20295 let avail_len = __input.len();
20296 let mut payload_buf = [0; Self::ENCODED_LEN];
20297 let mut buf = if avail_len < Self::ENCODED_LEN {
20298 payload_buf[0..avail_len].copy_from_slice(__input);
20299 Bytes::new(&payload_buf)
20300 } else {
20301 Bytes::new(__input)
20302 };
20303 let mut __struct = Self::default();
20304 __struct.nav_roll = buf.get_f32_le();
20305 __struct.nav_pitch = buf.get_f32_le();
20306 __struct.alt_error = buf.get_f32_le();
20307 __struct.aspd_error = buf.get_f32_le();
20308 __struct.xtrack_error = buf.get_f32_le();
20309 __struct.nav_bearing = buf.get_i16_le();
20310 __struct.target_bearing = buf.get_i16_le();
20311 __struct.wp_dist = buf.get_u16_le();
20312 Ok(__struct)
20313 }
20314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20315 let mut __tmp = BytesMut::new(bytes);
20316 #[allow(clippy::absurd_extreme_comparisons)]
20317 #[allow(unused_comparisons)]
20318 if __tmp.remaining() < Self::ENCODED_LEN {
20319 panic!(
20320 "buffer is too small (need {} bytes, but got {})",
20321 Self::ENCODED_LEN,
20322 __tmp.remaining(),
20323 )
20324 }
20325 __tmp.put_f32_le(self.nav_roll);
20326 __tmp.put_f32_le(self.nav_pitch);
20327 __tmp.put_f32_le(self.alt_error);
20328 __tmp.put_f32_le(self.aspd_error);
20329 __tmp.put_f32_le(self.xtrack_error);
20330 __tmp.put_i16_le(self.nav_bearing);
20331 __tmp.put_i16_le(self.target_bearing);
20332 __tmp.put_u16_le(self.wp_dist);
20333 if matches!(version, MavlinkVersion::V2) {
20334 let len = __tmp.len();
20335 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20336 } else {
20337 __tmp.len()
20338 }
20339 }
20340}
20341#[doc = "id: 330"]
20342#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20343#[derive(Debug, Clone, PartialEq)]
20344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20346pub struct OBSTACLE_DISTANCE_DATA {
20347 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20348 pub time_usec: u64,
20349 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20351 pub distances: [u16; 72],
20352 #[doc = "Minimum distance the sensor can measure."]
20353 pub min_distance: u16,
20354 #[doc = "Maximum distance the sensor can measure."]
20355 pub max_distance: u16,
20356 #[doc = "Class id of the distance sensor type."]
20357 pub sensor_type: MavDistanceSensor,
20358 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20359 pub increment: u8,
20360 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20361 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20362 pub increment_f: f32,
20363 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20364 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20365 pub angle_offset: f32,
20366 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20367 #[cfg_attr(feature = "serde", serde(default))]
20368 pub frame: MavFrame,
20369}
20370impl OBSTACLE_DISTANCE_DATA {
20371 pub const ENCODED_LEN: usize = 167usize;
20372 pub const DEFAULT: Self = Self {
20373 time_usec: 0_u64,
20374 distances: [0_u16; 72usize],
20375 min_distance: 0_u16,
20376 max_distance: 0_u16,
20377 sensor_type: MavDistanceSensor::DEFAULT,
20378 increment: 0_u8,
20379 increment_f: 0.0_f32,
20380 angle_offset: 0.0_f32,
20381 frame: MavFrame::DEFAULT,
20382 };
20383 #[cfg(feature = "arbitrary")]
20384 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20385 use arbitrary::{Arbitrary, Unstructured};
20386 let mut buf = [0u8; 1024];
20387 rng.fill_bytes(&mut buf);
20388 let mut unstructured = Unstructured::new(&buf);
20389 Self::arbitrary(&mut unstructured).unwrap_or_default()
20390 }
20391}
20392impl Default for OBSTACLE_DISTANCE_DATA {
20393 fn default() -> Self {
20394 Self::DEFAULT.clone()
20395 }
20396}
20397impl MessageData for OBSTACLE_DISTANCE_DATA {
20398 type Message = MavMessage;
20399 const ID: u32 = 330u32;
20400 const NAME: &'static str = "OBSTACLE_DISTANCE";
20401 const EXTRA_CRC: u8 = 23u8;
20402 const ENCODED_LEN: usize = 167usize;
20403 fn deser(
20404 _version: MavlinkVersion,
20405 __input: &[u8],
20406 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20407 let avail_len = __input.len();
20408 let mut payload_buf = [0; Self::ENCODED_LEN];
20409 let mut buf = if avail_len < Self::ENCODED_LEN {
20410 payload_buf[0..avail_len].copy_from_slice(__input);
20411 Bytes::new(&payload_buf)
20412 } else {
20413 Bytes::new(__input)
20414 };
20415 let mut __struct = Self::default();
20416 __struct.time_usec = buf.get_u64_le();
20417 for v in &mut __struct.distances {
20418 let val = buf.get_u16_le();
20419 *v = val;
20420 }
20421 __struct.min_distance = buf.get_u16_le();
20422 __struct.max_distance = buf.get_u16_le();
20423 let tmp = buf.get_u8();
20424 __struct.sensor_type =
20425 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20426 enum_type: "MavDistanceSensor",
20427 value: tmp as u32,
20428 })?;
20429 __struct.increment = buf.get_u8();
20430 __struct.increment_f = buf.get_f32_le();
20431 __struct.angle_offset = buf.get_f32_le();
20432 let tmp = buf.get_u8();
20433 __struct.frame =
20434 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20435 enum_type: "MavFrame",
20436 value: tmp as u32,
20437 })?;
20438 Ok(__struct)
20439 }
20440 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20441 let mut __tmp = BytesMut::new(bytes);
20442 #[allow(clippy::absurd_extreme_comparisons)]
20443 #[allow(unused_comparisons)]
20444 if __tmp.remaining() < Self::ENCODED_LEN {
20445 panic!(
20446 "buffer is too small (need {} bytes, but got {})",
20447 Self::ENCODED_LEN,
20448 __tmp.remaining(),
20449 )
20450 }
20451 __tmp.put_u64_le(self.time_usec);
20452 for val in &self.distances {
20453 __tmp.put_u16_le(*val);
20454 }
20455 __tmp.put_u16_le(self.min_distance);
20456 __tmp.put_u16_le(self.max_distance);
20457 __tmp.put_u8(self.sensor_type as u8);
20458 __tmp.put_u8(self.increment);
20459 __tmp.put_f32_le(self.increment_f);
20460 __tmp.put_f32_le(self.angle_offset);
20461 __tmp.put_u8(self.frame as u8);
20462 if matches!(version, MavlinkVersion::V2) {
20463 let len = __tmp.len();
20464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20465 } else {
20466 __tmp.len()
20467 }
20468 }
20469}
20470#[doc = "id: 331"]
20471#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20472#[derive(Debug, Clone, PartialEq)]
20473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20474#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20475pub struct ODOMETRY_DATA {
20476 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20477 pub time_usec: u64,
20478 #[doc = "X Position"]
20479 pub x: f32,
20480 #[doc = "Y Position"]
20481 pub y: f32,
20482 #[doc = "Z Position"]
20483 pub z: f32,
20484 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20486 pub q: [f32; 4],
20487 #[doc = "X linear speed"]
20488 pub vx: f32,
20489 #[doc = "Y linear speed"]
20490 pub vy: f32,
20491 #[doc = "Z linear speed"]
20492 pub vz: f32,
20493 #[doc = "Roll angular speed"]
20494 pub rollspeed: f32,
20495 #[doc = "Pitch angular speed"]
20496 pub pitchspeed: f32,
20497 #[doc = "Yaw angular speed"]
20498 pub yawspeed: f32,
20499 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20500 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20501 pub pose_covariance: [f32; 21],
20502 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20503 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20504 pub velocity_covariance: [f32; 21],
20505 #[doc = "Coordinate frame of reference for the pose data."]
20506 pub frame_id: MavFrame,
20507 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20508 pub child_frame_id: MavFrame,
20509 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20510 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20511 pub reset_counter: u8,
20512 #[doc = "Type of estimator that is providing the odometry."]
20513 #[cfg_attr(feature = "serde", serde(default))]
20514 pub estimator_type: MavEstimatorType,
20515 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20516 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20517 pub quality: i8,
20518}
20519impl ODOMETRY_DATA {
20520 pub const ENCODED_LEN: usize = 233usize;
20521 pub const DEFAULT: Self = Self {
20522 time_usec: 0_u64,
20523 x: 0.0_f32,
20524 y: 0.0_f32,
20525 z: 0.0_f32,
20526 q: [0.0_f32; 4usize],
20527 vx: 0.0_f32,
20528 vy: 0.0_f32,
20529 vz: 0.0_f32,
20530 rollspeed: 0.0_f32,
20531 pitchspeed: 0.0_f32,
20532 yawspeed: 0.0_f32,
20533 pose_covariance: [0.0_f32; 21usize],
20534 velocity_covariance: [0.0_f32; 21usize],
20535 frame_id: MavFrame::DEFAULT,
20536 child_frame_id: MavFrame::DEFAULT,
20537 reset_counter: 0_u8,
20538 estimator_type: MavEstimatorType::DEFAULT,
20539 quality: 0_i8,
20540 };
20541 #[cfg(feature = "arbitrary")]
20542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20543 use arbitrary::{Arbitrary, Unstructured};
20544 let mut buf = [0u8; 1024];
20545 rng.fill_bytes(&mut buf);
20546 let mut unstructured = Unstructured::new(&buf);
20547 Self::arbitrary(&mut unstructured).unwrap_or_default()
20548 }
20549}
20550impl Default for ODOMETRY_DATA {
20551 fn default() -> Self {
20552 Self::DEFAULT.clone()
20553 }
20554}
20555impl MessageData for ODOMETRY_DATA {
20556 type Message = MavMessage;
20557 const ID: u32 = 331u32;
20558 const NAME: &'static str = "ODOMETRY";
20559 const EXTRA_CRC: u8 = 91u8;
20560 const ENCODED_LEN: usize = 233usize;
20561 fn deser(
20562 _version: MavlinkVersion,
20563 __input: &[u8],
20564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20565 let avail_len = __input.len();
20566 let mut payload_buf = [0; Self::ENCODED_LEN];
20567 let mut buf = if avail_len < Self::ENCODED_LEN {
20568 payload_buf[0..avail_len].copy_from_slice(__input);
20569 Bytes::new(&payload_buf)
20570 } else {
20571 Bytes::new(__input)
20572 };
20573 let mut __struct = Self::default();
20574 __struct.time_usec = buf.get_u64_le();
20575 __struct.x = buf.get_f32_le();
20576 __struct.y = buf.get_f32_le();
20577 __struct.z = buf.get_f32_le();
20578 for v in &mut __struct.q {
20579 let val = buf.get_f32_le();
20580 *v = val;
20581 }
20582 __struct.vx = buf.get_f32_le();
20583 __struct.vy = buf.get_f32_le();
20584 __struct.vz = buf.get_f32_le();
20585 __struct.rollspeed = buf.get_f32_le();
20586 __struct.pitchspeed = buf.get_f32_le();
20587 __struct.yawspeed = buf.get_f32_le();
20588 for v in &mut __struct.pose_covariance {
20589 let val = buf.get_f32_le();
20590 *v = val;
20591 }
20592 for v in &mut __struct.velocity_covariance {
20593 let val = buf.get_f32_le();
20594 *v = val;
20595 }
20596 let tmp = buf.get_u8();
20597 __struct.frame_id =
20598 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20599 enum_type: "MavFrame",
20600 value: tmp as u32,
20601 })?;
20602 let tmp = buf.get_u8();
20603 __struct.child_frame_id =
20604 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20605 enum_type: "MavFrame",
20606 value: tmp as u32,
20607 })?;
20608 __struct.reset_counter = buf.get_u8();
20609 let tmp = buf.get_u8();
20610 __struct.estimator_type =
20611 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20612 enum_type: "MavEstimatorType",
20613 value: tmp as u32,
20614 })?;
20615 __struct.quality = buf.get_i8();
20616 Ok(__struct)
20617 }
20618 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20619 let mut __tmp = BytesMut::new(bytes);
20620 #[allow(clippy::absurd_extreme_comparisons)]
20621 #[allow(unused_comparisons)]
20622 if __tmp.remaining() < Self::ENCODED_LEN {
20623 panic!(
20624 "buffer is too small (need {} bytes, but got {})",
20625 Self::ENCODED_LEN,
20626 __tmp.remaining(),
20627 )
20628 }
20629 __tmp.put_u64_le(self.time_usec);
20630 __tmp.put_f32_le(self.x);
20631 __tmp.put_f32_le(self.y);
20632 __tmp.put_f32_le(self.z);
20633 for val in &self.q {
20634 __tmp.put_f32_le(*val);
20635 }
20636 __tmp.put_f32_le(self.vx);
20637 __tmp.put_f32_le(self.vy);
20638 __tmp.put_f32_le(self.vz);
20639 __tmp.put_f32_le(self.rollspeed);
20640 __tmp.put_f32_le(self.pitchspeed);
20641 __tmp.put_f32_le(self.yawspeed);
20642 for val in &self.pose_covariance {
20643 __tmp.put_f32_le(*val);
20644 }
20645 for val in &self.velocity_covariance {
20646 __tmp.put_f32_le(*val);
20647 }
20648 __tmp.put_u8(self.frame_id as u8);
20649 __tmp.put_u8(self.child_frame_id as u8);
20650 __tmp.put_u8(self.reset_counter);
20651 __tmp.put_u8(self.estimator_type as u8);
20652 __tmp.put_i8(self.quality);
20653 if matches!(version, MavlinkVersion::V2) {
20654 let len = __tmp.len();
20655 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20656 } else {
20657 __tmp.len()
20658 }
20659 }
20660}
20661#[doc = "id: 390"]
20662#[doc = "Hardware status sent by an onboard computer."]
20663#[derive(Debug, Clone, PartialEq)]
20664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20666pub struct ONBOARD_COMPUTER_STATUS_DATA {
20667 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20668 pub time_usec: u64,
20669 #[doc = "Time since system boot."]
20670 pub uptime: u32,
20671 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20672 pub ram_usage: u32,
20673 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
20674 pub ram_total: u32,
20675 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
20676 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20677 pub storage_type: [u32; 4],
20678 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20679 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20680 pub storage_usage: [u32; 4],
20681 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
20682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20683 pub storage_total: [u32; 4],
20684 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
20685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20686 pub link_type: [u32; 6],
20687 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
20688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20689 pub link_tx_rate: [u32; 6],
20690 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
20691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20692 pub link_rx_rate: [u32; 6],
20693 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
20694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20695 pub link_tx_max: [u32; 6],
20696 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
20697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20698 pub link_rx_max: [u32; 6],
20699 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
20700 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20701 pub fan_speed: [i16; 4],
20702 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
20703 pub mavtype: u8,
20704 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20705 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20706 pub cpu_cores: [u8; 8],
20707 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20709 pub cpu_combined: [u8; 10],
20710 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
20711 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20712 pub gpu_cores: [u8; 4],
20713 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
20714 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20715 pub gpu_combined: [u8; 10],
20716 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
20717 pub temperature_board: i8,
20718 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
20719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20720 pub temperature_core: [i8; 8],
20721}
20722impl ONBOARD_COMPUTER_STATUS_DATA {
20723 pub const ENCODED_LEN: usize = 238usize;
20724 pub const DEFAULT: Self = Self {
20725 time_usec: 0_u64,
20726 uptime: 0_u32,
20727 ram_usage: 0_u32,
20728 ram_total: 0_u32,
20729 storage_type: [0_u32; 4usize],
20730 storage_usage: [0_u32; 4usize],
20731 storage_total: [0_u32; 4usize],
20732 link_type: [0_u32; 6usize],
20733 link_tx_rate: [0_u32; 6usize],
20734 link_rx_rate: [0_u32; 6usize],
20735 link_tx_max: [0_u32; 6usize],
20736 link_rx_max: [0_u32; 6usize],
20737 fan_speed: [0_i16; 4usize],
20738 mavtype: 0_u8,
20739 cpu_cores: [0_u8; 8usize],
20740 cpu_combined: [0_u8; 10usize],
20741 gpu_cores: [0_u8; 4usize],
20742 gpu_combined: [0_u8; 10usize],
20743 temperature_board: 0_i8,
20744 temperature_core: [0_i8; 8usize],
20745 };
20746 #[cfg(feature = "arbitrary")]
20747 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20748 use arbitrary::{Arbitrary, Unstructured};
20749 let mut buf = [0u8; 1024];
20750 rng.fill_bytes(&mut buf);
20751 let mut unstructured = Unstructured::new(&buf);
20752 Self::arbitrary(&mut unstructured).unwrap_or_default()
20753 }
20754}
20755impl Default for ONBOARD_COMPUTER_STATUS_DATA {
20756 fn default() -> Self {
20757 Self::DEFAULT.clone()
20758 }
20759}
20760impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
20761 type Message = MavMessage;
20762 const ID: u32 = 390u32;
20763 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
20764 const EXTRA_CRC: u8 = 156u8;
20765 const ENCODED_LEN: usize = 238usize;
20766 fn deser(
20767 _version: MavlinkVersion,
20768 __input: &[u8],
20769 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20770 let avail_len = __input.len();
20771 let mut payload_buf = [0; Self::ENCODED_LEN];
20772 let mut buf = if avail_len < Self::ENCODED_LEN {
20773 payload_buf[0..avail_len].copy_from_slice(__input);
20774 Bytes::new(&payload_buf)
20775 } else {
20776 Bytes::new(__input)
20777 };
20778 let mut __struct = Self::default();
20779 __struct.time_usec = buf.get_u64_le();
20780 __struct.uptime = buf.get_u32_le();
20781 __struct.ram_usage = buf.get_u32_le();
20782 __struct.ram_total = buf.get_u32_le();
20783 for v in &mut __struct.storage_type {
20784 let val = buf.get_u32_le();
20785 *v = val;
20786 }
20787 for v in &mut __struct.storage_usage {
20788 let val = buf.get_u32_le();
20789 *v = val;
20790 }
20791 for v in &mut __struct.storage_total {
20792 let val = buf.get_u32_le();
20793 *v = val;
20794 }
20795 for v in &mut __struct.link_type {
20796 let val = buf.get_u32_le();
20797 *v = val;
20798 }
20799 for v in &mut __struct.link_tx_rate {
20800 let val = buf.get_u32_le();
20801 *v = val;
20802 }
20803 for v in &mut __struct.link_rx_rate {
20804 let val = buf.get_u32_le();
20805 *v = val;
20806 }
20807 for v in &mut __struct.link_tx_max {
20808 let val = buf.get_u32_le();
20809 *v = val;
20810 }
20811 for v in &mut __struct.link_rx_max {
20812 let val = buf.get_u32_le();
20813 *v = val;
20814 }
20815 for v in &mut __struct.fan_speed {
20816 let val = buf.get_i16_le();
20817 *v = val;
20818 }
20819 __struct.mavtype = buf.get_u8();
20820 for v in &mut __struct.cpu_cores {
20821 let val = buf.get_u8();
20822 *v = val;
20823 }
20824 for v in &mut __struct.cpu_combined {
20825 let val = buf.get_u8();
20826 *v = val;
20827 }
20828 for v in &mut __struct.gpu_cores {
20829 let val = buf.get_u8();
20830 *v = val;
20831 }
20832 for v in &mut __struct.gpu_combined {
20833 let val = buf.get_u8();
20834 *v = val;
20835 }
20836 __struct.temperature_board = buf.get_i8();
20837 for v in &mut __struct.temperature_core {
20838 let val = buf.get_i8();
20839 *v = val;
20840 }
20841 Ok(__struct)
20842 }
20843 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20844 let mut __tmp = BytesMut::new(bytes);
20845 #[allow(clippy::absurd_extreme_comparisons)]
20846 #[allow(unused_comparisons)]
20847 if __tmp.remaining() < Self::ENCODED_LEN {
20848 panic!(
20849 "buffer is too small (need {} bytes, but got {})",
20850 Self::ENCODED_LEN,
20851 __tmp.remaining(),
20852 )
20853 }
20854 __tmp.put_u64_le(self.time_usec);
20855 __tmp.put_u32_le(self.uptime);
20856 __tmp.put_u32_le(self.ram_usage);
20857 __tmp.put_u32_le(self.ram_total);
20858 for val in &self.storage_type {
20859 __tmp.put_u32_le(*val);
20860 }
20861 for val in &self.storage_usage {
20862 __tmp.put_u32_le(*val);
20863 }
20864 for val in &self.storage_total {
20865 __tmp.put_u32_le(*val);
20866 }
20867 for val in &self.link_type {
20868 __tmp.put_u32_le(*val);
20869 }
20870 for val in &self.link_tx_rate {
20871 __tmp.put_u32_le(*val);
20872 }
20873 for val in &self.link_rx_rate {
20874 __tmp.put_u32_le(*val);
20875 }
20876 for val in &self.link_tx_max {
20877 __tmp.put_u32_le(*val);
20878 }
20879 for val in &self.link_rx_max {
20880 __tmp.put_u32_le(*val);
20881 }
20882 for val in &self.fan_speed {
20883 __tmp.put_i16_le(*val);
20884 }
20885 __tmp.put_u8(self.mavtype);
20886 for val in &self.cpu_cores {
20887 __tmp.put_u8(*val);
20888 }
20889 for val in &self.cpu_combined {
20890 __tmp.put_u8(*val);
20891 }
20892 for val in &self.gpu_cores {
20893 __tmp.put_u8(*val);
20894 }
20895 for val in &self.gpu_combined {
20896 __tmp.put_u8(*val);
20897 }
20898 __tmp.put_i8(self.temperature_board);
20899 for val in &self.temperature_core {
20900 __tmp.put_i8(*val);
20901 }
20902 if matches!(version, MavlinkVersion::V2) {
20903 let len = __tmp.len();
20904 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20905 } else {
20906 __tmp.len()
20907 }
20908 }
20909}
20910#[doc = "id: 12918"]
20911#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
20912#[derive(Debug, Clone, PartialEq)]
20913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20915pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
20916 #[doc = "Status level indicating if arming is allowed."]
20917 pub status: MavOdidArmStatus,
20918 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
20919 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20920 pub error: [u8; 50],
20921}
20922impl OPEN_DRONE_ID_ARM_STATUS_DATA {
20923 pub const ENCODED_LEN: usize = 51usize;
20924 pub const DEFAULT: Self = Self {
20925 status: MavOdidArmStatus::DEFAULT,
20926 error: [0_u8; 50usize],
20927 };
20928 #[cfg(feature = "arbitrary")]
20929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20930 use arbitrary::{Arbitrary, Unstructured};
20931 let mut buf = [0u8; 1024];
20932 rng.fill_bytes(&mut buf);
20933 let mut unstructured = Unstructured::new(&buf);
20934 Self::arbitrary(&mut unstructured).unwrap_or_default()
20935 }
20936}
20937impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
20938 fn default() -> Self {
20939 Self::DEFAULT.clone()
20940 }
20941}
20942impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
20943 type Message = MavMessage;
20944 const ID: u32 = 12918u32;
20945 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
20946 const EXTRA_CRC: u8 = 139u8;
20947 const ENCODED_LEN: usize = 51usize;
20948 fn deser(
20949 _version: MavlinkVersion,
20950 __input: &[u8],
20951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20952 let avail_len = __input.len();
20953 let mut payload_buf = [0; Self::ENCODED_LEN];
20954 let mut buf = if avail_len < Self::ENCODED_LEN {
20955 payload_buf[0..avail_len].copy_from_slice(__input);
20956 Bytes::new(&payload_buf)
20957 } else {
20958 Bytes::new(__input)
20959 };
20960 let mut __struct = Self::default();
20961 let tmp = buf.get_u8();
20962 __struct.status =
20963 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20964 enum_type: "MavOdidArmStatus",
20965 value: tmp as u32,
20966 })?;
20967 for v in &mut __struct.error {
20968 let val = buf.get_u8();
20969 *v = val;
20970 }
20971 Ok(__struct)
20972 }
20973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20974 let mut __tmp = BytesMut::new(bytes);
20975 #[allow(clippy::absurd_extreme_comparisons)]
20976 #[allow(unused_comparisons)]
20977 if __tmp.remaining() < Self::ENCODED_LEN {
20978 panic!(
20979 "buffer is too small (need {} bytes, but got {})",
20980 Self::ENCODED_LEN,
20981 __tmp.remaining(),
20982 )
20983 }
20984 __tmp.put_u8(self.status as u8);
20985 for val in &self.error {
20986 __tmp.put_u8(*val);
20987 }
20988 if matches!(version, MavlinkVersion::V2) {
20989 let len = __tmp.len();
20990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20991 } else {
20992 __tmp.len()
20993 }
20994 }
20995}
20996#[doc = "id: 12902"]
20997#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
20998#[derive(Debug, Clone, PartialEq)]
20999#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21000#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21001pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21002 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21003 pub timestamp: u32,
21004 #[doc = "System ID (0 for broadcast)."]
21005 pub target_system: u8,
21006 #[doc = "Component ID (0 for broadcast)."]
21007 pub target_component: u8,
21008 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21009 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21010 pub id_or_mac: [u8; 20],
21011 #[doc = "Indicates the type of authentication."]
21012 pub authentication_type: MavOdidAuthType,
21013 #[doc = "Allowed range is 0 - 15."]
21014 pub data_page: u8,
21015 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21016 pub last_page_index: u8,
21017 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21018 pub length: u8,
21019 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21020 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21021 pub authentication_data: [u8; 23],
21022}
21023impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21024 pub const ENCODED_LEN: usize = 53usize;
21025 pub const DEFAULT: Self = Self {
21026 timestamp: 0_u32,
21027 target_system: 0_u8,
21028 target_component: 0_u8,
21029 id_or_mac: [0_u8; 20usize],
21030 authentication_type: MavOdidAuthType::DEFAULT,
21031 data_page: 0_u8,
21032 last_page_index: 0_u8,
21033 length: 0_u8,
21034 authentication_data: [0_u8; 23usize],
21035 };
21036 #[cfg(feature = "arbitrary")]
21037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21038 use arbitrary::{Arbitrary, Unstructured};
21039 let mut buf = [0u8; 1024];
21040 rng.fill_bytes(&mut buf);
21041 let mut unstructured = Unstructured::new(&buf);
21042 Self::arbitrary(&mut unstructured).unwrap_or_default()
21043 }
21044}
21045impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21046 fn default() -> Self {
21047 Self::DEFAULT.clone()
21048 }
21049}
21050impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21051 type Message = MavMessage;
21052 const ID: u32 = 12902u32;
21053 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21054 const EXTRA_CRC: u8 = 140u8;
21055 const ENCODED_LEN: usize = 53usize;
21056 fn deser(
21057 _version: MavlinkVersion,
21058 __input: &[u8],
21059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21060 let avail_len = __input.len();
21061 let mut payload_buf = [0; Self::ENCODED_LEN];
21062 let mut buf = if avail_len < Self::ENCODED_LEN {
21063 payload_buf[0..avail_len].copy_from_slice(__input);
21064 Bytes::new(&payload_buf)
21065 } else {
21066 Bytes::new(__input)
21067 };
21068 let mut __struct = Self::default();
21069 __struct.timestamp = buf.get_u32_le();
21070 __struct.target_system = buf.get_u8();
21071 __struct.target_component = buf.get_u8();
21072 for v in &mut __struct.id_or_mac {
21073 let val = buf.get_u8();
21074 *v = val;
21075 }
21076 let tmp = buf.get_u8();
21077 __struct.authentication_type =
21078 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21079 enum_type: "MavOdidAuthType",
21080 value: tmp as u32,
21081 })?;
21082 __struct.data_page = buf.get_u8();
21083 __struct.last_page_index = buf.get_u8();
21084 __struct.length = buf.get_u8();
21085 for v in &mut __struct.authentication_data {
21086 let val = buf.get_u8();
21087 *v = val;
21088 }
21089 Ok(__struct)
21090 }
21091 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21092 let mut __tmp = BytesMut::new(bytes);
21093 #[allow(clippy::absurd_extreme_comparisons)]
21094 #[allow(unused_comparisons)]
21095 if __tmp.remaining() < Self::ENCODED_LEN {
21096 panic!(
21097 "buffer is too small (need {} bytes, but got {})",
21098 Self::ENCODED_LEN,
21099 __tmp.remaining(),
21100 )
21101 }
21102 __tmp.put_u32_le(self.timestamp);
21103 __tmp.put_u8(self.target_system);
21104 __tmp.put_u8(self.target_component);
21105 for val in &self.id_or_mac {
21106 __tmp.put_u8(*val);
21107 }
21108 __tmp.put_u8(self.authentication_type as u8);
21109 __tmp.put_u8(self.data_page);
21110 __tmp.put_u8(self.last_page_index);
21111 __tmp.put_u8(self.length);
21112 for val in &self.authentication_data {
21113 __tmp.put_u8(*val);
21114 }
21115 if matches!(version, MavlinkVersion::V2) {
21116 let len = __tmp.len();
21117 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21118 } else {
21119 __tmp.len()
21120 }
21121 }
21122}
21123#[doc = "id: 12900"]
21124#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21125#[derive(Debug, Clone, PartialEq)]
21126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21128pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21129 #[doc = "System ID (0 for broadcast)."]
21130 pub target_system: u8,
21131 #[doc = "Component ID (0 for broadcast)."]
21132 pub target_component: u8,
21133 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21135 pub id_or_mac: [u8; 20],
21136 #[doc = "Indicates the format for the uas_id field of this message."]
21137 pub id_type: MavOdidIdType,
21138 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21139 pub ua_type: MavOdidUaType,
21140 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21142 pub uas_id: [u8; 20],
21143}
21144impl OPEN_DRONE_ID_BASIC_ID_DATA {
21145 pub const ENCODED_LEN: usize = 44usize;
21146 pub const DEFAULT: Self = Self {
21147 target_system: 0_u8,
21148 target_component: 0_u8,
21149 id_or_mac: [0_u8; 20usize],
21150 id_type: MavOdidIdType::DEFAULT,
21151 ua_type: MavOdidUaType::DEFAULT,
21152 uas_id: [0_u8; 20usize],
21153 };
21154 #[cfg(feature = "arbitrary")]
21155 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21156 use arbitrary::{Arbitrary, Unstructured};
21157 let mut buf = [0u8; 1024];
21158 rng.fill_bytes(&mut buf);
21159 let mut unstructured = Unstructured::new(&buf);
21160 Self::arbitrary(&mut unstructured).unwrap_or_default()
21161 }
21162}
21163impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21164 fn default() -> Self {
21165 Self::DEFAULT.clone()
21166 }
21167}
21168impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21169 type Message = MavMessage;
21170 const ID: u32 = 12900u32;
21171 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21172 const EXTRA_CRC: u8 = 114u8;
21173 const ENCODED_LEN: usize = 44usize;
21174 fn deser(
21175 _version: MavlinkVersion,
21176 __input: &[u8],
21177 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21178 let avail_len = __input.len();
21179 let mut payload_buf = [0; Self::ENCODED_LEN];
21180 let mut buf = if avail_len < Self::ENCODED_LEN {
21181 payload_buf[0..avail_len].copy_from_slice(__input);
21182 Bytes::new(&payload_buf)
21183 } else {
21184 Bytes::new(__input)
21185 };
21186 let mut __struct = Self::default();
21187 __struct.target_system = buf.get_u8();
21188 __struct.target_component = buf.get_u8();
21189 for v in &mut __struct.id_or_mac {
21190 let val = buf.get_u8();
21191 *v = val;
21192 }
21193 let tmp = buf.get_u8();
21194 __struct.id_type =
21195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21196 enum_type: "MavOdidIdType",
21197 value: tmp as u32,
21198 })?;
21199 let tmp = buf.get_u8();
21200 __struct.ua_type =
21201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21202 enum_type: "MavOdidUaType",
21203 value: tmp as u32,
21204 })?;
21205 for v in &mut __struct.uas_id {
21206 let val = buf.get_u8();
21207 *v = val;
21208 }
21209 Ok(__struct)
21210 }
21211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21212 let mut __tmp = BytesMut::new(bytes);
21213 #[allow(clippy::absurd_extreme_comparisons)]
21214 #[allow(unused_comparisons)]
21215 if __tmp.remaining() < Self::ENCODED_LEN {
21216 panic!(
21217 "buffer is too small (need {} bytes, but got {})",
21218 Self::ENCODED_LEN,
21219 __tmp.remaining(),
21220 )
21221 }
21222 __tmp.put_u8(self.target_system);
21223 __tmp.put_u8(self.target_component);
21224 for val in &self.id_or_mac {
21225 __tmp.put_u8(*val);
21226 }
21227 __tmp.put_u8(self.id_type as u8);
21228 __tmp.put_u8(self.ua_type as u8);
21229 for val in &self.uas_id {
21230 __tmp.put_u8(*val);
21231 }
21232 if matches!(version, MavlinkVersion::V2) {
21233 let len = __tmp.len();
21234 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21235 } else {
21236 __tmp.len()
21237 }
21238 }
21239}
21240#[doc = "id: 12901"]
21241#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21242#[derive(Debug, Clone, PartialEq)]
21243#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21245pub struct OPEN_DRONE_ID_LOCATION_DATA {
21246 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21247 pub latitude: i32,
21248 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21249 pub longitude: i32,
21250 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21251 pub altitude_barometric: f32,
21252 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21253 pub altitude_geodetic: f32,
21254 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21255 pub height: f32,
21256 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21257 pub timestamp: f32,
21258 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21259 pub direction: u16,
21260 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21261 pub speed_horizontal: u16,
21262 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21263 pub speed_vertical: i16,
21264 #[doc = "System ID (0 for broadcast)."]
21265 pub target_system: u8,
21266 #[doc = "Component ID (0 for broadcast)."]
21267 pub target_component: u8,
21268 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21270 pub id_or_mac: [u8; 20],
21271 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21272 pub status: MavOdidStatus,
21273 #[doc = "Indicates the reference point for the height field."]
21274 pub height_reference: MavOdidHeightRef,
21275 #[doc = "The accuracy of the horizontal position."]
21276 pub horizontal_accuracy: MavOdidHorAcc,
21277 #[doc = "The accuracy of the vertical position."]
21278 pub vertical_accuracy: MavOdidVerAcc,
21279 #[doc = "The accuracy of the barometric altitude."]
21280 pub barometer_accuracy: MavOdidVerAcc,
21281 #[doc = "The accuracy of the horizontal and vertical speed."]
21282 pub speed_accuracy: MavOdidSpeedAcc,
21283 #[doc = "The accuracy of the timestamps."]
21284 pub timestamp_accuracy: MavOdidTimeAcc,
21285}
21286impl OPEN_DRONE_ID_LOCATION_DATA {
21287 pub const ENCODED_LEN: usize = 59usize;
21288 pub const DEFAULT: Self = Self {
21289 latitude: 0_i32,
21290 longitude: 0_i32,
21291 altitude_barometric: 0.0_f32,
21292 altitude_geodetic: 0.0_f32,
21293 height: 0.0_f32,
21294 timestamp: 0.0_f32,
21295 direction: 0_u16,
21296 speed_horizontal: 0_u16,
21297 speed_vertical: 0_i16,
21298 target_system: 0_u8,
21299 target_component: 0_u8,
21300 id_or_mac: [0_u8; 20usize],
21301 status: MavOdidStatus::DEFAULT,
21302 height_reference: MavOdidHeightRef::DEFAULT,
21303 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21304 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21305 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21306 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21307 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21308 };
21309 #[cfg(feature = "arbitrary")]
21310 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21311 use arbitrary::{Arbitrary, Unstructured};
21312 let mut buf = [0u8; 1024];
21313 rng.fill_bytes(&mut buf);
21314 let mut unstructured = Unstructured::new(&buf);
21315 Self::arbitrary(&mut unstructured).unwrap_or_default()
21316 }
21317}
21318impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21319 fn default() -> Self {
21320 Self::DEFAULT.clone()
21321 }
21322}
21323impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21324 type Message = MavMessage;
21325 const ID: u32 = 12901u32;
21326 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21327 const EXTRA_CRC: u8 = 254u8;
21328 const ENCODED_LEN: usize = 59usize;
21329 fn deser(
21330 _version: MavlinkVersion,
21331 __input: &[u8],
21332 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21333 let avail_len = __input.len();
21334 let mut payload_buf = [0; Self::ENCODED_LEN];
21335 let mut buf = if avail_len < Self::ENCODED_LEN {
21336 payload_buf[0..avail_len].copy_from_slice(__input);
21337 Bytes::new(&payload_buf)
21338 } else {
21339 Bytes::new(__input)
21340 };
21341 let mut __struct = Self::default();
21342 __struct.latitude = buf.get_i32_le();
21343 __struct.longitude = buf.get_i32_le();
21344 __struct.altitude_barometric = buf.get_f32_le();
21345 __struct.altitude_geodetic = buf.get_f32_le();
21346 __struct.height = buf.get_f32_le();
21347 __struct.timestamp = buf.get_f32_le();
21348 __struct.direction = buf.get_u16_le();
21349 __struct.speed_horizontal = buf.get_u16_le();
21350 __struct.speed_vertical = buf.get_i16_le();
21351 __struct.target_system = buf.get_u8();
21352 __struct.target_component = buf.get_u8();
21353 for v in &mut __struct.id_or_mac {
21354 let val = buf.get_u8();
21355 *v = val;
21356 }
21357 let tmp = buf.get_u8();
21358 __struct.status =
21359 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21360 enum_type: "MavOdidStatus",
21361 value: tmp as u32,
21362 })?;
21363 let tmp = buf.get_u8();
21364 __struct.height_reference =
21365 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21366 enum_type: "MavOdidHeightRef",
21367 value: tmp as u32,
21368 })?;
21369 let tmp = buf.get_u8();
21370 __struct.horizontal_accuracy =
21371 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21372 enum_type: "MavOdidHorAcc",
21373 value: tmp as u32,
21374 })?;
21375 let tmp = buf.get_u8();
21376 __struct.vertical_accuracy =
21377 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21378 enum_type: "MavOdidVerAcc",
21379 value: tmp as u32,
21380 })?;
21381 let tmp = buf.get_u8();
21382 __struct.barometer_accuracy =
21383 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21384 enum_type: "MavOdidVerAcc",
21385 value: tmp as u32,
21386 })?;
21387 let tmp = buf.get_u8();
21388 __struct.speed_accuracy =
21389 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21390 enum_type: "MavOdidSpeedAcc",
21391 value: tmp as u32,
21392 })?;
21393 let tmp = buf.get_u8();
21394 __struct.timestamp_accuracy =
21395 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21396 enum_type: "MavOdidTimeAcc",
21397 value: tmp as u32,
21398 })?;
21399 Ok(__struct)
21400 }
21401 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21402 let mut __tmp = BytesMut::new(bytes);
21403 #[allow(clippy::absurd_extreme_comparisons)]
21404 #[allow(unused_comparisons)]
21405 if __tmp.remaining() < Self::ENCODED_LEN {
21406 panic!(
21407 "buffer is too small (need {} bytes, but got {})",
21408 Self::ENCODED_LEN,
21409 __tmp.remaining(),
21410 )
21411 }
21412 __tmp.put_i32_le(self.latitude);
21413 __tmp.put_i32_le(self.longitude);
21414 __tmp.put_f32_le(self.altitude_barometric);
21415 __tmp.put_f32_le(self.altitude_geodetic);
21416 __tmp.put_f32_le(self.height);
21417 __tmp.put_f32_le(self.timestamp);
21418 __tmp.put_u16_le(self.direction);
21419 __tmp.put_u16_le(self.speed_horizontal);
21420 __tmp.put_i16_le(self.speed_vertical);
21421 __tmp.put_u8(self.target_system);
21422 __tmp.put_u8(self.target_component);
21423 for val in &self.id_or_mac {
21424 __tmp.put_u8(*val);
21425 }
21426 __tmp.put_u8(self.status as u8);
21427 __tmp.put_u8(self.height_reference as u8);
21428 __tmp.put_u8(self.horizontal_accuracy as u8);
21429 __tmp.put_u8(self.vertical_accuracy as u8);
21430 __tmp.put_u8(self.barometer_accuracy as u8);
21431 __tmp.put_u8(self.speed_accuracy as u8);
21432 __tmp.put_u8(self.timestamp_accuracy as u8);
21433 if matches!(version, MavlinkVersion::V2) {
21434 let len = __tmp.len();
21435 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21436 } else {
21437 __tmp.len()
21438 }
21439 }
21440}
21441#[doc = "id: 12915"]
21442#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21443#[derive(Debug, Clone, PartialEq)]
21444#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21445#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21446pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21447 #[doc = "System ID (0 for broadcast)."]
21448 pub target_system: u8,
21449 #[doc = "Component ID (0 for broadcast)."]
21450 pub target_component: u8,
21451 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21452 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21453 pub id_or_mac: [u8; 20],
21454 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21455 pub single_message_size: u8,
21456 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21457 pub msg_pack_size: u8,
21458 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21459 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21460 pub messages: [u8; 225],
21461}
21462impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21463 pub const ENCODED_LEN: usize = 249usize;
21464 pub const DEFAULT: Self = Self {
21465 target_system: 0_u8,
21466 target_component: 0_u8,
21467 id_or_mac: [0_u8; 20usize],
21468 single_message_size: 0_u8,
21469 msg_pack_size: 0_u8,
21470 messages: [0_u8; 225usize],
21471 };
21472 #[cfg(feature = "arbitrary")]
21473 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21474 use arbitrary::{Arbitrary, Unstructured};
21475 let mut buf = [0u8; 1024];
21476 rng.fill_bytes(&mut buf);
21477 let mut unstructured = Unstructured::new(&buf);
21478 Self::arbitrary(&mut unstructured).unwrap_or_default()
21479 }
21480}
21481impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21482 fn default() -> Self {
21483 Self::DEFAULT.clone()
21484 }
21485}
21486impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21487 type Message = MavMessage;
21488 const ID: u32 = 12915u32;
21489 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21490 const EXTRA_CRC: u8 = 94u8;
21491 const ENCODED_LEN: usize = 249usize;
21492 fn deser(
21493 _version: MavlinkVersion,
21494 __input: &[u8],
21495 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21496 let avail_len = __input.len();
21497 let mut payload_buf = [0; Self::ENCODED_LEN];
21498 let mut buf = if avail_len < Self::ENCODED_LEN {
21499 payload_buf[0..avail_len].copy_from_slice(__input);
21500 Bytes::new(&payload_buf)
21501 } else {
21502 Bytes::new(__input)
21503 };
21504 let mut __struct = Self::default();
21505 __struct.target_system = buf.get_u8();
21506 __struct.target_component = buf.get_u8();
21507 for v in &mut __struct.id_or_mac {
21508 let val = buf.get_u8();
21509 *v = val;
21510 }
21511 __struct.single_message_size = buf.get_u8();
21512 __struct.msg_pack_size = buf.get_u8();
21513 for v in &mut __struct.messages {
21514 let val = buf.get_u8();
21515 *v = val;
21516 }
21517 Ok(__struct)
21518 }
21519 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21520 let mut __tmp = BytesMut::new(bytes);
21521 #[allow(clippy::absurd_extreme_comparisons)]
21522 #[allow(unused_comparisons)]
21523 if __tmp.remaining() < Self::ENCODED_LEN {
21524 panic!(
21525 "buffer is too small (need {} bytes, but got {})",
21526 Self::ENCODED_LEN,
21527 __tmp.remaining(),
21528 )
21529 }
21530 __tmp.put_u8(self.target_system);
21531 __tmp.put_u8(self.target_component);
21532 for val in &self.id_or_mac {
21533 __tmp.put_u8(*val);
21534 }
21535 __tmp.put_u8(self.single_message_size);
21536 __tmp.put_u8(self.msg_pack_size);
21537 for val in &self.messages {
21538 __tmp.put_u8(*val);
21539 }
21540 if matches!(version, MavlinkVersion::V2) {
21541 let len = __tmp.len();
21542 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21543 } else {
21544 __tmp.len()
21545 }
21546 }
21547}
21548#[doc = "id: 12905"]
21549#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21550#[derive(Debug, Clone, PartialEq)]
21551#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21552#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21553pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21554 #[doc = "System ID (0 for broadcast)."]
21555 pub target_system: u8,
21556 #[doc = "Component ID (0 for broadcast)."]
21557 pub target_component: u8,
21558 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21559 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21560 pub id_or_mac: [u8; 20],
21561 #[doc = "Indicates the type of the operator_id field."]
21562 pub operator_id_type: MavOdidOperatorIdType,
21563 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21564 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21565 pub operator_id: [u8; 20],
21566}
21567impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21568 pub const ENCODED_LEN: usize = 43usize;
21569 pub const DEFAULT: Self = Self {
21570 target_system: 0_u8,
21571 target_component: 0_u8,
21572 id_or_mac: [0_u8; 20usize],
21573 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21574 operator_id: [0_u8; 20usize],
21575 };
21576 #[cfg(feature = "arbitrary")]
21577 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21578 use arbitrary::{Arbitrary, Unstructured};
21579 let mut buf = [0u8; 1024];
21580 rng.fill_bytes(&mut buf);
21581 let mut unstructured = Unstructured::new(&buf);
21582 Self::arbitrary(&mut unstructured).unwrap_or_default()
21583 }
21584}
21585impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21586 fn default() -> Self {
21587 Self::DEFAULT.clone()
21588 }
21589}
21590impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
21591 type Message = MavMessage;
21592 const ID: u32 = 12905u32;
21593 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
21594 const EXTRA_CRC: u8 = 49u8;
21595 const ENCODED_LEN: usize = 43usize;
21596 fn deser(
21597 _version: MavlinkVersion,
21598 __input: &[u8],
21599 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21600 let avail_len = __input.len();
21601 let mut payload_buf = [0; Self::ENCODED_LEN];
21602 let mut buf = if avail_len < Self::ENCODED_LEN {
21603 payload_buf[0..avail_len].copy_from_slice(__input);
21604 Bytes::new(&payload_buf)
21605 } else {
21606 Bytes::new(__input)
21607 };
21608 let mut __struct = Self::default();
21609 __struct.target_system = buf.get_u8();
21610 __struct.target_component = buf.get_u8();
21611 for v in &mut __struct.id_or_mac {
21612 let val = buf.get_u8();
21613 *v = val;
21614 }
21615 let tmp = buf.get_u8();
21616 __struct.operator_id_type =
21617 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21618 enum_type: "MavOdidOperatorIdType",
21619 value: tmp as u32,
21620 })?;
21621 for v in &mut __struct.operator_id {
21622 let val = buf.get_u8();
21623 *v = val;
21624 }
21625 Ok(__struct)
21626 }
21627 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21628 let mut __tmp = BytesMut::new(bytes);
21629 #[allow(clippy::absurd_extreme_comparisons)]
21630 #[allow(unused_comparisons)]
21631 if __tmp.remaining() < Self::ENCODED_LEN {
21632 panic!(
21633 "buffer is too small (need {} bytes, but got {})",
21634 Self::ENCODED_LEN,
21635 __tmp.remaining(),
21636 )
21637 }
21638 __tmp.put_u8(self.target_system);
21639 __tmp.put_u8(self.target_component);
21640 for val in &self.id_or_mac {
21641 __tmp.put_u8(*val);
21642 }
21643 __tmp.put_u8(self.operator_id_type as u8);
21644 for val in &self.operator_id {
21645 __tmp.put_u8(*val);
21646 }
21647 if matches!(version, MavlinkVersion::V2) {
21648 let len = __tmp.len();
21649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21650 } else {
21651 __tmp.len()
21652 }
21653 }
21654}
21655#[doc = "id: 12903"]
21656#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
21657#[derive(Debug, Clone, PartialEq)]
21658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21660pub struct OPEN_DRONE_ID_SELF_ID_DATA {
21661 #[doc = "System ID (0 for broadcast)."]
21662 pub target_system: u8,
21663 #[doc = "Component ID (0 for broadcast)."]
21664 pub target_component: u8,
21665 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21666 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21667 pub id_or_mac: [u8; 20],
21668 #[doc = "Indicates the type of the description field."]
21669 pub description_type: MavOdidDescType,
21670 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21671 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21672 pub description: [u8; 23],
21673}
21674impl OPEN_DRONE_ID_SELF_ID_DATA {
21675 pub const ENCODED_LEN: usize = 46usize;
21676 pub const DEFAULT: Self = Self {
21677 target_system: 0_u8,
21678 target_component: 0_u8,
21679 id_or_mac: [0_u8; 20usize],
21680 description_type: MavOdidDescType::DEFAULT,
21681 description: [0_u8; 23usize],
21682 };
21683 #[cfg(feature = "arbitrary")]
21684 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21685 use arbitrary::{Arbitrary, Unstructured};
21686 let mut buf = [0u8; 1024];
21687 rng.fill_bytes(&mut buf);
21688 let mut unstructured = Unstructured::new(&buf);
21689 Self::arbitrary(&mut unstructured).unwrap_or_default()
21690 }
21691}
21692impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
21693 fn default() -> Self {
21694 Self::DEFAULT.clone()
21695 }
21696}
21697impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
21698 type Message = MavMessage;
21699 const ID: u32 = 12903u32;
21700 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
21701 const EXTRA_CRC: u8 = 249u8;
21702 const ENCODED_LEN: usize = 46usize;
21703 fn deser(
21704 _version: MavlinkVersion,
21705 __input: &[u8],
21706 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21707 let avail_len = __input.len();
21708 let mut payload_buf = [0; Self::ENCODED_LEN];
21709 let mut buf = if avail_len < Self::ENCODED_LEN {
21710 payload_buf[0..avail_len].copy_from_slice(__input);
21711 Bytes::new(&payload_buf)
21712 } else {
21713 Bytes::new(__input)
21714 };
21715 let mut __struct = Self::default();
21716 __struct.target_system = buf.get_u8();
21717 __struct.target_component = buf.get_u8();
21718 for v in &mut __struct.id_or_mac {
21719 let val = buf.get_u8();
21720 *v = val;
21721 }
21722 let tmp = buf.get_u8();
21723 __struct.description_type =
21724 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21725 enum_type: "MavOdidDescType",
21726 value: tmp as u32,
21727 })?;
21728 for v in &mut __struct.description {
21729 let val = buf.get_u8();
21730 *v = val;
21731 }
21732 Ok(__struct)
21733 }
21734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21735 let mut __tmp = BytesMut::new(bytes);
21736 #[allow(clippy::absurd_extreme_comparisons)]
21737 #[allow(unused_comparisons)]
21738 if __tmp.remaining() < Self::ENCODED_LEN {
21739 panic!(
21740 "buffer is too small (need {} bytes, but got {})",
21741 Self::ENCODED_LEN,
21742 __tmp.remaining(),
21743 )
21744 }
21745 __tmp.put_u8(self.target_system);
21746 __tmp.put_u8(self.target_component);
21747 for val in &self.id_or_mac {
21748 __tmp.put_u8(*val);
21749 }
21750 __tmp.put_u8(self.description_type as u8);
21751 for val in &self.description {
21752 __tmp.put_u8(*val);
21753 }
21754 if matches!(version, MavlinkVersion::V2) {
21755 let len = __tmp.len();
21756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21757 } else {
21758 __tmp.len()
21759 }
21760 }
21761}
21762#[doc = "id: 12904"]
21763#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
21764#[derive(Debug, Clone, PartialEq)]
21765#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21766#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21767pub struct OPEN_DRONE_ID_SYSTEM_DATA {
21768 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21769 pub operator_latitude: i32,
21770 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21771 pub operator_longitude: i32,
21772 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21773 pub area_ceiling: f32,
21774 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
21775 pub area_floor: f32,
21776 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21777 pub operator_altitude_geo: f32,
21778 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21779 pub timestamp: u32,
21780 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
21781 pub area_count: u16,
21782 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
21783 pub area_radius: u16,
21784 #[doc = "System ID (0 for broadcast)."]
21785 pub target_system: u8,
21786 #[doc = "Component ID (0 for broadcast)."]
21787 pub target_component: u8,
21788 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21790 pub id_or_mac: [u8; 20],
21791 #[doc = "Specifies the operator location type."]
21792 pub operator_location_type: MavOdidOperatorLocationType,
21793 #[doc = "Specifies the classification type of the UA."]
21794 pub classification_type: MavOdidClassificationType,
21795 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
21796 pub category_eu: MavOdidCategoryEu,
21797 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
21798 pub class_eu: MavOdidClassEu,
21799}
21800impl OPEN_DRONE_ID_SYSTEM_DATA {
21801 pub const ENCODED_LEN: usize = 54usize;
21802 pub const DEFAULT: Self = Self {
21803 operator_latitude: 0_i32,
21804 operator_longitude: 0_i32,
21805 area_ceiling: 0.0_f32,
21806 area_floor: 0.0_f32,
21807 operator_altitude_geo: 0.0_f32,
21808 timestamp: 0_u32,
21809 area_count: 0_u16,
21810 area_radius: 0_u16,
21811 target_system: 0_u8,
21812 target_component: 0_u8,
21813 id_or_mac: [0_u8; 20usize],
21814 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
21815 classification_type: MavOdidClassificationType::DEFAULT,
21816 category_eu: MavOdidCategoryEu::DEFAULT,
21817 class_eu: MavOdidClassEu::DEFAULT,
21818 };
21819 #[cfg(feature = "arbitrary")]
21820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21821 use arbitrary::{Arbitrary, Unstructured};
21822 let mut buf = [0u8; 1024];
21823 rng.fill_bytes(&mut buf);
21824 let mut unstructured = Unstructured::new(&buf);
21825 Self::arbitrary(&mut unstructured).unwrap_or_default()
21826 }
21827}
21828impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
21829 fn default() -> Self {
21830 Self::DEFAULT.clone()
21831 }
21832}
21833impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
21834 type Message = MavMessage;
21835 const ID: u32 = 12904u32;
21836 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
21837 const EXTRA_CRC: u8 = 77u8;
21838 const ENCODED_LEN: usize = 54usize;
21839 fn deser(
21840 _version: MavlinkVersion,
21841 __input: &[u8],
21842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21843 let avail_len = __input.len();
21844 let mut payload_buf = [0; Self::ENCODED_LEN];
21845 let mut buf = if avail_len < Self::ENCODED_LEN {
21846 payload_buf[0..avail_len].copy_from_slice(__input);
21847 Bytes::new(&payload_buf)
21848 } else {
21849 Bytes::new(__input)
21850 };
21851 let mut __struct = Self::default();
21852 __struct.operator_latitude = buf.get_i32_le();
21853 __struct.operator_longitude = buf.get_i32_le();
21854 __struct.area_ceiling = buf.get_f32_le();
21855 __struct.area_floor = buf.get_f32_le();
21856 __struct.operator_altitude_geo = buf.get_f32_le();
21857 __struct.timestamp = buf.get_u32_le();
21858 __struct.area_count = buf.get_u16_le();
21859 __struct.area_radius = buf.get_u16_le();
21860 __struct.target_system = buf.get_u8();
21861 __struct.target_component = buf.get_u8();
21862 for v in &mut __struct.id_or_mac {
21863 let val = buf.get_u8();
21864 *v = val;
21865 }
21866 let tmp = buf.get_u8();
21867 __struct.operator_location_type =
21868 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21869 enum_type: "MavOdidOperatorLocationType",
21870 value: tmp as u32,
21871 })?;
21872 let tmp = buf.get_u8();
21873 __struct.classification_type =
21874 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21875 enum_type: "MavOdidClassificationType",
21876 value: tmp as u32,
21877 })?;
21878 let tmp = buf.get_u8();
21879 __struct.category_eu =
21880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21881 enum_type: "MavOdidCategoryEu",
21882 value: tmp as u32,
21883 })?;
21884 let tmp = buf.get_u8();
21885 __struct.class_eu =
21886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21887 enum_type: "MavOdidClassEu",
21888 value: tmp as u32,
21889 })?;
21890 Ok(__struct)
21891 }
21892 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21893 let mut __tmp = BytesMut::new(bytes);
21894 #[allow(clippy::absurd_extreme_comparisons)]
21895 #[allow(unused_comparisons)]
21896 if __tmp.remaining() < Self::ENCODED_LEN {
21897 panic!(
21898 "buffer is too small (need {} bytes, but got {})",
21899 Self::ENCODED_LEN,
21900 __tmp.remaining(),
21901 )
21902 }
21903 __tmp.put_i32_le(self.operator_latitude);
21904 __tmp.put_i32_le(self.operator_longitude);
21905 __tmp.put_f32_le(self.area_ceiling);
21906 __tmp.put_f32_le(self.area_floor);
21907 __tmp.put_f32_le(self.operator_altitude_geo);
21908 __tmp.put_u32_le(self.timestamp);
21909 __tmp.put_u16_le(self.area_count);
21910 __tmp.put_u16_le(self.area_radius);
21911 __tmp.put_u8(self.target_system);
21912 __tmp.put_u8(self.target_component);
21913 for val in &self.id_or_mac {
21914 __tmp.put_u8(*val);
21915 }
21916 __tmp.put_u8(self.operator_location_type as u8);
21917 __tmp.put_u8(self.classification_type as u8);
21918 __tmp.put_u8(self.category_eu as u8);
21919 __tmp.put_u8(self.class_eu as u8);
21920 if matches!(version, MavlinkVersion::V2) {
21921 let len = __tmp.len();
21922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21923 } else {
21924 __tmp.len()
21925 }
21926 }
21927}
21928#[doc = "id: 12919"]
21929#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
21930#[derive(Debug, Clone, PartialEq)]
21931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21933pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21934 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
21935 pub operator_latitude: i32,
21936 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
21937 pub operator_longitude: i32,
21938 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
21939 pub operator_altitude_geo: f32,
21940 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21941 pub timestamp: u32,
21942 #[doc = "System ID (0 for broadcast)."]
21943 pub target_system: u8,
21944 #[doc = "Component ID (0 for broadcast)."]
21945 pub target_component: u8,
21946}
21947impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21948 pub const ENCODED_LEN: usize = 18usize;
21949 pub const DEFAULT: Self = Self {
21950 operator_latitude: 0_i32,
21951 operator_longitude: 0_i32,
21952 operator_altitude_geo: 0.0_f32,
21953 timestamp: 0_u32,
21954 target_system: 0_u8,
21955 target_component: 0_u8,
21956 };
21957 #[cfg(feature = "arbitrary")]
21958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21959 use arbitrary::{Arbitrary, Unstructured};
21960 let mut buf = [0u8; 1024];
21961 rng.fill_bytes(&mut buf);
21962 let mut unstructured = Unstructured::new(&buf);
21963 Self::arbitrary(&mut unstructured).unwrap_or_default()
21964 }
21965}
21966impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21967 fn default() -> Self {
21968 Self::DEFAULT.clone()
21969 }
21970}
21971impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
21972 type Message = MavMessage;
21973 const ID: u32 = 12919u32;
21974 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
21975 const EXTRA_CRC: u8 = 7u8;
21976 const ENCODED_LEN: usize = 18usize;
21977 fn deser(
21978 _version: MavlinkVersion,
21979 __input: &[u8],
21980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21981 let avail_len = __input.len();
21982 let mut payload_buf = [0; Self::ENCODED_LEN];
21983 let mut buf = if avail_len < Self::ENCODED_LEN {
21984 payload_buf[0..avail_len].copy_from_slice(__input);
21985 Bytes::new(&payload_buf)
21986 } else {
21987 Bytes::new(__input)
21988 };
21989 let mut __struct = Self::default();
21990 __struct.operator_latitude = buf.get_i32_le();
21991 __struct.operator_longitude = buf.get_i32_le();
21992 __struct.operator_altitude_geo = buf.get_f32_le();
21993 __struct.timestamp = buf.get_u32_le();
21994 __struct.target_system = buf.get_u8();
21995 __struct.target_component = buf.get_u8();
21996 Ok(__struct)
21997 }
21998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21999 let mut __tmp = BytesMut::new(bytes);
22000 #[allow(clippy::absurd_extreme_comparisons)]
22001 #[allow(unused_comparisons)]
22002 if __tmp.remaining() < Self::ENCODED_LEN {
22003 panic!(
22004 "buffer is too small (need {} bytes, but got {})",
22005 Self::ENCODED_LEN,
22006 __tmp.remaining(),
22007 )
22008 }
22009 __tmp.put_i32_le(self.operator_latitude);
22010 __tmp.put_i32_le(self.operator_longitude);
22011 __tmp.put_f32_le(self.operator_altitude_geo);
22012 __tmp.put_u32_le(self.timestamp);
22013 __tmp.put_u8(self.target_system);
22014 __tmp.put_u8(self.target_component);
22015 if matches!(version, MavlinkVersion::V2) {
22016 let len = __tmp.len();
22017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22018 } else {
22019 __tmp.len()
22020 }
22021 }
22022}
22023#[doc = "id: 100"]
22024#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22025#[derive(Debug, Clone, PartialEq)]
22026#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22027#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22028pub struct OPTICAL_FLOW_DATA {
22029 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22030 pub time_usec: u64,
22031 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22032 pub flow_comp_m_x: f32,
22033 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22034 pub flow_comp_m_y: f32,
22035 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22036 pub ground_distance: f32,
22037 #[doc = "Flow in x-sensor direction"]
22038 pub flow_x: i16,
22039 #[doc = "Flow in y-sensor direction"]
22040 pub flow_y: i16,
22041 #[doc = "Sensor ID"]
22042 pub sensor_id: u8,
22043 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22044 pub quality: u8,
22045 #[doc = "Flow rate about X axis"]
22046 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22047 pub flow_rate_x: f32,
22048 #[doc = "Flow rate about Y axis"]
22049 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22050 pub flow_rate_y: f32,
22051}
22052impl OPTICAL_FLOW_DATA {
22053 pub const ENCODED_LEN: usize = 34usize;
22054 pub const DEFAULT: Self = Self {
22055 time_usec: 0_u64,
22056 flow_comp_m_x: 0.0_f32,
22057 flow_comp_m_y: 0.0_f32,
22058 ground_distance: 0.0_f32,
22059 flow_x: 0_i16,
22060 flow_y: 0_i16,
22061 sensor_id: 0_u8,
22062 quality: 0_u8,
22063 flow_rate_x: 0.0_f32,
22064 flow_rate_y: 0.0_f32,
22065 };
22066 #[cfg(feature = "arbitrary")]
22067 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22068 use arbitrary::{Arbitrary, Unstructured};
22069 let mut buf = [0u8; 1024];
22070 rng.fill_bytes(&mut buf);
22071 let mut unstructured = Unstructured::new(&buf);
22072 Self::arbitrary(&mut unstructured).unwrap_or_default()
22073 }
22074}
22075impl Default for OPTICAL_FLOW_DATA {
22076 fn default() -> Self {
22077 Self::DEFAULT.clone()
22078 }
22079}
22080impl MessageData for OPTICAL_FLOW_DATA {
22081 type Message = MavMessage;
22082 const ID: u32 = 100u32;
22083 const NAME: &'static str = "OPTICAL_FLOW";
22084 const EXTRA_CRC: u8 = 175u8;
22085 const ENCODED_LEN: usize = 34usize;
22086 fn deser(
22087 _version: MavlinkVersion,
22088 __input: &[u8],
22089 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22090 let avail_len = __input.len();
22091 let mut payload_buf = [0; Self::ENCODED_LEN];
22092 let mut buf = if avail_len < Self::ENCODED_LEN {
22093 payload_buf[0..avail_len].copy_from_slice(__input);
22094 Bytes::new(&payload_buf)
22095 } else {
22096 Bytes::new(__input)
22097 };
22098 let mut __struct = Self::default();
22099 __struct.time_usec = buf.get_u64_le();
22100 __struct.flow_comp_m_x = buf.get_f32_le();
22101 __struct.flow_comp_m_y = buf.get_f32_le();
22102 __struct.ground_distance = buf.get_f32_le();
22103 __struct.flow_x = buf.get_i16_le();
22104 __struct.flow_y = buf.get_i16_le();
22105 __struct.sensor_id = buf.get_u8();
22106 __struct.quality = buf.get_u8();
22107 __struct.flow_rate_x = buf.get_f32_le();
22108 __struct.flow_rate_y = buf.get_f32_le();
22109 Ok(__struct)
22110 }
22111 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22112 let mut __tmp = BytesMut::new(bytes);
22113 #[allow(clippy::absurd_extreme_comparisons)]
22114 #[allow(unused_comparisons)]
22115 if __tmp.remaining() < Self::ENCODED_LEN {
22116 panic!(
22117 "buffer is too small (need {} bytes, but got {})",
22118 Self::ENCODED_LEN,
22119 __tmp.remaining(),
22120 )
22121 }
22122 __tmp.put_u64_le(self.time_usec);
22123 __tmp.put_f32_le(self.flow_comp_m_x);
22124 __tmp.put_f32_le(self.flow_comp_m_y);
22125 __tmp.put_f32_le(self.ground_distance);
22126 __tmp.put_i16_le(self.flow_x);
22127 __tmp.put_i16_le(self.flow_y);
22128 __tmp.put_u8(self.sensor_id);
22129 __tmp.put_u8(self.quality);
22130 __tmp.put_f32_le(self.flow_rate_x);
22131 __tmp.put_f32_le(self.flow_rate_y);
22132 if matches!(version, MavlinkVersion::V2) {
22133 let len = __tmp.len();
22134 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22135 } else {
22136 __tmp.len()
22137 }
22138 }
22139}
22140#[doc = "id: 106"]
22141#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22142#[derive(Debug, Clone, PartialEq)]
22143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22145pub struct OPTICAL_FLOW_RAD_DATA {
22146 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22147 pub time_usec: u64,
22148 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22149 pub integration_time_us: u32,
22150 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22151 pub integrated_x: f32,
22152 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22153 pub integrated_y: f32,
22154 #[doc = "RH rotation around X axis"]
22155 pub integrated_xgyro: f32,
22156 #[doc = "RH rotation around Y axis"]
22157 pub integrated_ygyro: f32,
22158 #[doc = "RH rotation around Z axis"]
22159 pub integrated_zgyro: f32,
22160 #[doc = "Time since the distance was sampled."]
22161 pub time_delta_distance_us: u32,
22162 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22163 pub distance: f32,
22164 #[doc = "Temperature"]
22165 pub temperature: i16,
22166 #[doc = "Sensor ID"]
22167 pub sensor_id: u8,
22168 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22169 pub quality: u8,
22170}
22171impl OPTICAL_FLOW_RAD_DATA {
22172 pub const ENCODED_LEN: usize = 44usize;
22173 pub const DEFAULT: Self = Self {
22174 time_usec: 0_u64,
22175 integration_time_us: 0_u32,
22176 integrated_x: 0.0_f32,
22177 integrated_y: 0.0_f32,
22178 integrated_xgyro: 0.0_f32,
22179 integrated_ygyro: 0.0_f32,
22180 integrated_zgyro: 0.0_f32,
22181 time_delta_distance_us: 0_u32,
22182 distance: 0.0_f32,
22183 temperature: 0_i16,
22184 sensor_id: 0_u8,
22185 quality: 0_u8,
22186 };
22187 #[cfg(feature = "arbitrary")]
22188 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22189 use arbitrary::{Arbitrary, Unstructured};
22190 let mut buf = [0u8; 1024];
22191 rng.fill_bytes(&mut buf);
22192 let mut unstructured = Unstructured::new(&buf);
22193 Self::arbitrary(&mut unstructured).unwrap_or_default()
22194 }
22195}
22196impl Default for OPTICAL_FLOW_RAD_DATA {
22197 fn default() -> Self {
22198 Self::DEFAULT.clone()
22199 }
22200}
22201impl MessageData for OPTICAL_FLOW_RAD_DATA {
22202 type Message = MavMessage;
22203 const ID: u32 = 106u32;
22204 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22205 const EXTRA_CRC: u8 = 138u8;
22206 const ENCODED_LEN: usize = 44usize;
22207 fn deser(
22208 _version: MavlinkVersion,
22209 __input: &[u8],
22210 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22211 let avail_len = __input.len();
22212 let mut payload_buf = [0; Self::ENCODED_LEN];
22213 let mut buf = if avail_len < Self::ENCODED_LEN {
22214 payload_buf[0..avail_len].copy_from_slice(__input);
22215 Bytes::new(&payload_buf)
22216 } else {
22217 Bytes::new(__input)
22218 };
22219 let mut __struct = Self::default();
22220 __struct.time_usec = buf.get_u64_le();
22221 __struct.integration_time_us = buf.get_u32_le();
22222 __struct.integrated_x = buf.get_f32_le();
22223 __struct.integrated_y = buf.get_f32_le();
22224 __struct.integrated_xgyro = buf.get_f32_le();
22225 __struct.integrated_ygyro = buf.get_f32_le();
22226 __struct.integrated_zgyro = buf.get_f32_le();
22227 __struct.time_delta_distance_us = buf.get_u32_le();
22228 __struct.distance = buf.get_f32_le();
22229 __struct.temperature = buf.get_i16_le();
22230 __struct.sensor_id = buf.get_u8();
22231 __struct.quality = buf.get_u8();
22232 Ok(__struct)
22233 }
22234 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22235 let mut __tmp = BytesMut::new(bytes);
22236 #[allow(clippy::absurd_extreme_comparisons)]
22237 #[allow(unused_comparisons)]
22238 if __tmp.remaining() < Self::ENCODED_LEN {
22239 panic!(
22240 "buffer is too small (need {} bytes, but got {})",
22241 Self::ENCODED_LEN,
22242 __tmp.remaining(),
22243 )
22244 }
22245 __tmp.put_u64_le(self.time_usec);
22246 __tmp.put_u32_le(self.integration_time_us);
22247 __tmp.put_f32_le(self.integrated_x);
22248 __tmp.put_f32_le(self.integrated_y);
22249 __tmp.put_f32_le(self.integrated_xgyro);
22250 __tmp.put_f32_le(self.integrated_ygyro);
22251 __tmp.put_f32_le(self.integrated_zgyro);
22252 __tmp.put_u32_le(self.time_delta_distance_us);
22253 __tmp.put_f32_le(self.distance);
22254 __tmp.put_i16_le(self.temperature);
22255 __tmp.put_u8(self.sensor_id);
22256 __tmp.put_u8(self.quality);
22257 if matches!(version, MavlinkVersion::V2) {
22258 let len = __tmp.len();
22259 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22260 } else {
22261 __tmp.len()
22262 }
22263 }
22264}
22265#[doc = "id: 360"]
22266#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22267#[derive(Debug, Clone, PartialEq)]
22268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22270pub struct ORBIT_EXECUTION_STATUS_DATA {
22271 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22272 pub time_usec: u64,
22273 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22274 pub radius: f32,
22275 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22276 pub x: i32,
22277 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22278 pub y: i32,
22279 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22280 pub z: f32,
22281 #[doc = "The coordinate system of the fields: x, y, z."]
22282 pub frame: MavFrame,
22283}
22284impl ORBIT_EXECUTION_STATUS_DATA {
22285 pub const ENCODED_LEN: usize = 25usize;
22286 pub const DEFAULT: Self = Self {
22287 time_usec: 0_u64,
22288 radius: 0.0_f32,
22289 x: 0_i32,
22290 y: 0_i32,
22291 z: 0.0_f32,
22292 frame: MavFrame::DEFAULT,
22293 };
22294 #[cfg(feature = "arbitrary")]
22295 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22296 use arbitrary::{Arbitrary, Unstructured};
22297 let mut buf = [0u8; 1024];
22298 rng.fill_bytes(&mut buf);
22299 let mut unstructured = Unstructured::new(&buf);
22300 Self::arbitrary(&mut unstructured).unwrap_or_default()
22301 }
22302}
22303impl Default for ORBIT_EXECUTION_STATUS_DATA {
22304 fn default() -> Self {
22305 Self::DEFAULT.clone()
22306 }
22307}
22308impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22309 type Message = MavMessage;
22310 const ID: u32 = 360u32;
22311 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22312 const EXTRA_CRC: u8 = 11u8;
22313 const ENCODED_LEN: usize = 25usize;
22314 fn deser(
22315 _version: MavlinkVersion,
22316 __input: &[u8],
22317 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22318 let avail_len = __input.len();
22319 let mut payload_buf = [0; Self::ENCODED_LEN];
22320 let mut buf = if avail_len < Self::ENCODED_LEN {
22321 payload_buf[0..avail_len].copy_from_slice(__input);
22322 Bytes::new(&payload_buf)
22323 } else {
22324 Bytes::new(__input)
22325 };
22326 let mut __struct = Self::default();
22327 __struct.time_usec = buf.get_u64_le();
22328 __struct.radius = buf.get_f32_le();
22329 __struct.x = buf.get_i32_le();
22330 __struct.y = buf.get_i32_le();
22331 __struct.z = buf.get_f32_le();
22332 let tmp = buf.get_u8();
22333 __struct.frame =
22334 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22335 enum_type: "MavFrame",
22336 value: tmp as u32,
22337 })?;
22338 Ok(__struct)
22339 }
22340 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22341 let mut __tmp = BytesMut::new(bytes);
22342 #[allow(clippy::absurd_extreme_comparisons)]
22343 #[allow(unused_comparisons)]
22344 if __tmp.remaining() < Self::ENCODED_LEN {
22345 panic!(
22346 "buffer is too small (need {} bytes, but got {})",
22347 Self::ENCODED_LEN,
22348 __tmp.remaining(),
22349 )
22350 }
22351 __tmp.put_u64_le(self.time_usec);
22352 __tmp.put_f32_le(self.radius);
22353 __tmp.put_i32_le(self.x);
22354 __tmp.put_i32_le(self.y);
22355 __tmp.put_f32_le(self.z);
22356 __tmp.put_u8(self.frame as u8);
22357 if matches!(version, MavlinkVersion::V2) {
22358 let len = __tmp.len();
22359 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22360 } else {
22361 __tmp.len()
22362 }
22363 }
22364}
22365#[doc = "id: 324"]
22366#[doc = "Response from a PARAM_EXT_SET message."]
22367#[derive(Debug, Clone, PartialEq)]
22368#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22370pub struct PARAM_EXT_ACK_DATA {
22371 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22372 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22373 pub param_id: [u8; 16],
22374 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22375 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22376 pub param_value: [u8; 128],
22377 #[doc = "Parameter type."]
22378 pub param_type: MavParamExtType,
22379 #[doc = "Result code."]
22380 pub param_result: ParamAck,
22381}
22382impl PARAM_EXT_ACK_DATA {
22383 pub const ENCODED_LEN: usize = 146usize;
22384 pub const DEFAULT: Self = Self {
22385 param_id: [0_u8; 16usize],
22386 param_value: [0_u8; 128usize],
22387 param_type: MavParamExtType::DEFAULT,
22388 param_result: ParamAck::DEFAULT,
22389 };
22390 #[cfg(feature = "arbitrary")]
22391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22392 use arbitrary::{Arbitrary, Unstructured};
22393 let mut buf = [0u8; 1024];
22394 rng.fill_bytes(&mut buf);
22395 let mut unstructured = Unstructured::new(&buf);
22396 Self::arbitrary(&mut unstructured).unwrap_or_default()
22397 }
22398}
22399impl Default for PARAM_EXT_ACK_DATA {
22400 fn default() -> Self {
22401 Self::DEFAULT.clone()
22402 }
22403}
22404impl MessageData for PARAM_EXT_ACK_DATA {
22405 type Message = MavMessage;
22406 const ID: u32 = 324u32;
22407 const NAME: &'static str = "PARAM_EXT_ACK";
22408 const EXTRA_CRC: u8 = 132u8;
22409 const ENCODED_LEN: usize = 146usize;
22410 fn deser(
22411 _version: MavlinkVersion,
22412 __input: &[u8],
22413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22414 let avail_len = __input.len();
22415 let mut payload_buf = [0; Self::ENCODED_LEN];
22416 let mut buf = if avail_len < Self::ENCODED_LEN {
22417 payload_buf[0..avail_len].copy_from_slice(__input);
22418 Bytes::new(&payload_buf)
22419 } else {
22420 Bytes::new(__input)
22421 };
22422 let mut __struct = Self::default();
22423 for v in &mut __struct.param_id {
22424 let val = buf.get_u8();
22425 *v = val;
22426 }
22427 for v in &mut __struct.param_value {
22428 let val = buf.get_u8();
22429 *v = val;
22430 }
22431 let tmp = buf.get_u8();
22432 __struct.param_type =
22433 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22434 enum_type: "MavParamExtType",
22435 value: tmp as u32,
22436 })?;
22437 let tmp = buf.get_u8();
22438 __struct.param_result =
22439 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22440 enum_type: "ParamAck",
22441 value: tmp as u32,
22442 })?;
22443 Ok(__struct)
22444 }
22445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22446 let mut __tmp = BytesMut::new(bytes);
22447 #[allow(clippy::absurd_extreme_comparisons)]
22448 #[allow(unused_comparisons)]
22449 if __tmp.remaining() < Self::ENCODED_LEN {
22450 panic!(
22451 "buffer is too small (need {} bytes, but got {})",
22452 Self::ENCODED_LEN,
22453 __tmp.remaining(),
22454 )
22455 }
22456 for val in &self.param_id {
22457 __tmp.put_u8(*val);
22458 }
22459 for val in &self.param_value {
22460 __tmp.put_u8(*val);
22461 }
22462 __tmp.put_u8(self.param_type as u8);
22463 __tmp.put_u8(self.param_result as u8);
22464 if matches!(version, MavlinkVersion::V2) {
22465 let len = __tmp.len();
22466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22467 } else {
22468 __tmp.len()
22469 }
22470 }
22471}
22472#[doc = "id: 321"]
22473#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22474#[derive(Debug, Clone, PartialEq)]
22475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22477pub struct PARAM_EXT_REQUEST_LIST_DATA {
22478 #[doc = "System ID"]
22479 pub target_system: u8,
22480 #[doc = "Component ID"]
22481 pub target_component: u8,
22482}
22483impl PARAM_EXT_REQUEST_LIST_DATA {
22484 pub const ENCODED_LEN: usize = 2usize;
22485 pub const DEFAULT: Self = Self {
22486 target_system: 0_u8,
22487 target_component: 0_u8,
22488 };
22489 #[cfg(feature = "arbitrary")]
22490 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22491 use arbitrary::{Arbitrary, Unstructured};
22492 let mut buf = [0u8; 1024];
22493 rng.fill_bytes(&mut buf);
22494 let mut unstructured = Unstructured::new(&buf);
22495 Self::arbitrary(&mut unstructured).unwrap_or_default()
22496 }
22497}
22498impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22499 fn default() -> Self {
22500 Self::DEFAULT.clone()
22501 }
22502}
22503impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22504 type Message = MavMessage;
22505 const ID: u32 = 321u32;
22506 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22507 const EXTRA_CRC: u8 = 88u8;
22508 const ENCODED_LEN: usize = 2usize;
22509 fn deser(
22510 _version: MavlinkVersion,
22511 __input: &[u8],
22512 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22513 let avail_len = __input.len();
22514 let mut payload_buf = [0; Self::ENCODED_LEN];
22515 let mut buf = if avail_len < Self::ENCODED_LEN {
22516 payload_buf[0..avail_len].copy_from_slice(__input);
22517 Bytes::new(&payload_buf)
22518 } else {
22519 Bytes::new(__input)
22520 };
22521 let mut __struct = Self::default();
22522 __struct.target_system = buf.get_u8();
22523 __struct.target_component = buf.get_u8();
22524 Ok(__struct)
22525 }
22526 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22527 let mut __tmp = BytesMut::new(bytes);
22528 #[allow(clippy::absurd_extreme_comparisons)]
22529 #[allow(unused_comparisons)]
22530 if __tmp.remaining() < Self::ENCODED_LEN {
22531 panic!(
22532 "buffer is too small (need {} bytes, but got {})",
22533 Self::ENCODED_LEN,
22534 __tmp.remaining(),
22535 )
22536 }
22537 __tmp.put_u8(self.target_system);
22538 __tmp.put_u8(self.target_component);
22539 if matches!(version, MavlinkVersion::V2) {
22540 let len = __tmp.len();
22541 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22542 } else {
22543 __tmp.len()
22544 }
22545 }
22546}
22547#[doc = "id: 320"]
22548#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22549#[derive(Debug, Clone, PartialEq)]
22550#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22551#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22552pub struct PARAM_EXT_REQUEST_READ_DATA {
22553 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22554 pub param_index: i16,
22555 #[doc = "System ID"]
22556 pub target_system: u8,
22557 #[doc = "Component ID"]
22558 pub target_component: u8,
22559 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22560 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22561 pub param_id: [u8; 16],
22562}
22563impl PARAM_EXT_REQUEST_READ_DATA {
22564 pub const ENCODED_LEN: usize = 20usize;
22565 pub const DEFAULT: Self = Self {
22566 param_index: 0_i16,
22567 target_system: 0_u8,
22568 target_component: 0_u8,
22569 param_id: [0_u8; 16usize],
22570 };
22571 #[cfg(feature = "arbitrary")]
22572 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22573 use arbitrary::{Arbitrary, Unstructured};
22574 let mut buf = [0u8; 1024];
22575 rng.fill_bytes(&mut buf);
22576 let mut unstructured = Unstructured::new(&buf);
22577 Self::arbitrary(&mut unstructured).unwrap_or_default()
22578 }
22579}
22580impl Default for PARAM_EXT_REQUEST_READ_DATA {
22581 fn default() -> Self {
22582 Self::DEFAULT.clone()
22583 }
22584}
22585impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
22586 type Message = MavMessage;
22587 const ID: u32 = 320u32;
22588 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
22589 const EXTRA_CRC: u8 = 243u8;
22590 const ENCODED_LEN: usize = 20usize;
22591 fn deser(
22592 _version: MavlinkVersion,
22593 __input: &[u8],
22594 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22595 let avail_len = __input.len();
22596 let mut payload_buf = [0; Self::ENCODED_LEN];
22597 let mut buf = if avail_len < Self::ENCODED_LEN {
22598 payload_buf[0..avail_len].copy_from_slice(__input);
22599 Bytes::new(&payload_buf)
22600 } else {
22601 Bytes::new(__input)
22602 };
22603 let mut __struct = Self::default();
22604 __struct.param_index = buf.get_i16_le();
22605 __struct.target_system = buf.get_u8();
22606 __struct.target_component = buf.get_u8();
22607 for v in &mut __struct.param_id {
22608 let val = buf.get_u8();
22609 *v = val;
22610 }
22611 Ok(__struct)
22612 }
22613 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22614 let mut __tmp = BytesMut::new(bytes);
22615 #[allow(clippy::absurd_extreme_comparisons)]
22616 #[allow(unused_comparisons)]
22617 if __tmp.remaining() < Self::ENCODED_LEN {
22618 panic!(
22619 "buffer is too small (need {} bytes, but got {})",
22620 Self::ENCODED_LEN,
22621 __tmp.remaining(),
22622 )
22623 }
22624 __tmp.put_i16_le(self.param_index);
22625 __tmp.put_u8(self.target_system);
22626 __tmp.put_u8(self.target_component);
22627 for val in &self.param_id {
22628 __tmp.put_u8(*val);
22629 }
22630 if matches!(version, MavlinkVersion::V2) {
22631 let len = __tmp.len();
22632 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22633 } else {
22634 __tmp.len()
22635 }
22636 }
22637}
22638#[doc = "id: 323"]
22639#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
22640#[derive(Debug, Clone, PartialEq)]
22641#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22642#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22643pub struct PARAM_EXT_SET_DATA {
22644 #[doc = "System ID"]
22645 pub target_system: u8,
22646 #[doc = "Component ID"]
22647 pub target_component: u8,
22648 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22650 pub param_id: [u8; 16],
22651 #[doc = "Parameter value"]
22652 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22653 pub param_value: [u8; 128],
22654 #[doc = "Parameter type."]
22655 pub param_type: MavParamExtType,
22656}
22657impl PARAM_EXT_SET_DATA {
22658 pub const ENCODED_LEN: usize = 147usize;
22659 pub const DEFAULT: Self = Self {
22660 target_system: 0_u8,
22661 target_component: 0_u8,
22662 param_id: [0_u8; 16usize],
22663 param_value: [0_u8; 128usize],
22664 param_type: MavParamExtType::DEFAULT,
22665 };
22666 #[cfg(feature = "arbitrary")]
22667 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22668 use arbitrary::{Arbitrary, Unstructured};
22669 let mut buf = [0u8; 1024];
22670 rng.fill_bytes(&mut buf);
22671 let mut unstructured = Unstructured::new(&buf);
22672 Self::arbitrary(&mut unstructured).unwrap_or_default()
22673 }
22674}
22675impl Default for PARAM_EXT_SET_DATA {
22676 fn default() -> Self {
22677 Self::DEFAULT.clone()
22678 }
22679}
22680impl MessageData for PARAM_EXT_SET_DATA {
22681 type Message = MavMessage;
22682 const ID: u32 = 323u32;
22683 const NAME: &'static str = "PARAM_EXT_SET";
22684 const EXTRA_CRC: u8 = 78u8;
22685 const ENCODED_LEN: usize = 147usize;
22686 fn deser(
22687 _version: MavlinkVersion,
22688 __input: &[u8],
22689 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22690 let avail_len = __input.len();
22691 let mut payload_buf = [0; Self::ENCODED_LEN];
22692 let mut buf = if avail_len < Self::ENCODED_LEN {
22693 payload_buf[0..avail_len].copy_from_slice(__input);
22694 Bytes::new(&payload_buf)
22695 } else {
22696 Bytes::new(__input)
22697 };
22698 let mut __struct = Self::default();
22699 __struct.target_system = buf.get_u8();
22700 __struct.target_component = buf.get_u8();
22701 for v in &mut __struct.param_id {
22702 let val = buf.get_u8();
22703 *v = val;
22704 }
22705 for v in &mut __struct.param_value {
22706 let val = buf.get_u8();
22707 *v = val;
22708 }
22709 let tmp = buf.get_u8();
22710 __struct.param_type =
22711 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22712 enum_type: "MavParamExtType",
22713 value: tmp as u32,
22714 })?;
22715 Ok(__struct)
22716 }
22717 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22718 let mut __tmp = BytesMut::new(bytes);
22719 #[allow(clippy::absurd_extreme_comparisons)]
22720 #[allow(unused_comparisons)]
22721 if __tmp.remaining() < Self::ENCODED_LEN {
22722 panic!(
22723 "buffer is too small (need {} bytes, but got {})",
22724 Self::ENCODED_LEN,
22725 __tmp.remaining(),
22726 )
22727 }
22728 __tmp.put_u8(self.target_system);
22729 __tmp.put_u8(self.target_component);
22730 for val in &self.param_id {
22731 __tmp.put_u8(*val);
22732 }
22733 for val in &self.param_value {
22734 __tmp.put_u8(*val);
22735 }
22736 __tmp.put_u8(self.param_type as u8);
22737 if matches!(version, MavlinkVersion::V2) {
22738 let len = __tmp.len();
22739 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22740 } else {
22741 __tmp.len()
22742 }
22743 }
22744}
22745#[doc = "id: 322"]
22746#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
22747#[derive(Debug, Clone, PartialEq)]
22748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22750pub struct PARAM_EXT_VALUE_DATA {
22751 #[doc = "Total number of parameters"]
22752 pub param_count: u16,
22753 #[doc = "Index of this parameter"]
22754 pub param_index: u16,
22755 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22756 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22757 pub param_id: [u8; 16],
22758 #[doc = "Parameter value"]
22759 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22760 pub param_value: [u8; 128],
22761 #[doc = "Parameter type."]
22762 pub param_type: MavParamExtType,
22763}
22764impl PARAM_EXT_VALUE_DATA {
22765 pub const ENCODED_LEN: usize = 149usize;
22766 pub const DEFAULT: Self = Self {
22767 param_count: 0_u16,
22768 param_index: 0_u16,
22769 param_id: [0_u8; 16usize],
22770 param_value: [0_u8; 128usize],
22771 param_type: MavParamExtType::DEFAULT,
22772 };
22773 #[cfg(feature = "arbitrary")]
22774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22775 use arbitrary::{Arbitrary, Unstructured};
22776 let mut buf = [0u8; 1024];
22777 rng.fill_bytes(&mut buf);
22778 let mut unstructured = Unstructured::new(&buf);
22779 Self::arbitrary(&mut unstructured).unwrap_or_default()
22780 }
22781}
22782impl Default for PARAM_EXT_VALUE_DATA {
22783 fn default() -> Self {
22784 Self::DEFAULT.clone()
22785 }
22786}
22787impl MessageData for PARAM_EXT_VALUE_DATA {
22788 type Message = MavMessage;
22789 const ID: u32 = 322u32;
22790 const NAME: &'static str = "PARAM_EXT_VALUE";
22791 const EXTRA_CRC: u8 = 243u8;
22792 const ENCODED_LEN: usize = 149usize;
22793 fn deser(
22794 _version: MavlinkVersion,
22795 __input: &[u8],
22796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22797 let avail_len = __input.len();
22798 let mut payload_buf = [0; Self::ENCODED_LEN];
22799 let mut buf = if avail_len < Self::ENCODED_LEN {
22800 payload_buf[0..avail_len].copy_from_slice(__input);
22801 Bytes::new(&payload_buf)
22802 } else {
22803 Bytes::new(__input)
22804 };
22805 let mut __struct = Self::default();
22806 __struct.param_count = buf.get_u16_le();
22807 __struct.param_index = buf.get_u16_le();
22808 for v in &mut __struct.param_id {
22809 let val = buf.get_u8();
22810 *v = val;
22811 }
22812 for v in &mut __struct.param_value {
22813 let val = buf.get_u8();
22814 *v = val;
22815 }
22816 let tmp = buf.get_u8();
22817 __struct.param_type =
22818 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22819 enum_type: "MavParamExtType",
22820 value: tmp as u32,
22821 })?;
22822 Ok(__struct)
22823 }
22824 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22825 let mut __tmp = BytesMut::new(bytes);
22826 #[allow(clippy::absurd_extreme_comparisons)]
22827 #[allow(unused_comparisons)]
22828 if __tmp.remaining() < Self::ENCODED_LEN {
22829 panic!(
22830 "buffer is too small (need {} bytes, but got {})",
22831 Self::ENCODED_LEN,
22832 __tmp.remaining(),
22833 )
22834 }
22835 __tmp.put_u16_le(self.param_count);
22836 __tmp.put_u16_le(self.param_index);
22837 for val in &self.param_id {
22838 __tmp.put_u8(*val);
22839 }
22840 for val in &self.param_value {
22841 __tmp.put_u8(*val);
22842 }
22843 __tmp.put_u8(self.param_type as u8);
22844 if matches!(version, MavlinkVersion::V2) {
22845 let len = __tmp.len();
22846 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22847 } else {
22848 __tmp.len()
22849 }
22850 }
22851}
22852#[doc = "id: 50"]
22853#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
22854#[derive(Debug, Clone, PartialEq)]
22855#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22856#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22857pub struct PARAM_MAP_RC_DATA {
22858 #[doc = "Initial parameter value"]
22859 pub param_value0: f32,
22860 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
22861 pub scale: f32,
22862 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
22863 pub param_value_min: f32,
22864 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
22865 pub param_value_max: f32,
22866 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
22867 pub param_index: i16,
22868 #[doc = "System ID"]
22869 pub target_system: u8,
22870 #[doc = "Component ID"]
22871 pub target_component: u8,
22872 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22873 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22874 pub param_id: [u8; 16],
22875 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
22876 pub parameter_rc_channel_index: u8,
22877}
22878impl PARAM_MAP_RC_DATA {
22879 pub const ENCODED_LEN: usize = 37usize;
22880 pub const DEFAULT: Self = Self {
22881 param_value0: 0.0_f32,
22882 scale: 0.0_f32,
22883 param_value_min: 0.0_f32,
22884 param_value_max: 0.0_f32,
22885 param_index: 0_i16,
22886 target_system: 0_u8,
22887 target_component: 0_u8,
22888 param_id: [0_u8; 16usize],
22889 parameter_rc_channel_index: 0_u8,
22890 };
22891 #[cfg(feature = "arbitrary")]
22892 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22893 use arbitrary::{Arbitrary, Unstructured};
22894 let mut buf = [0u8; 1024];
22895 rng.fill_bytes(&mut buf);
22896 let mut unstructured = Unstructured::new(&buf);
22897 Self::arbitrary(&mut unstructured).unwrap_or_default()
22898 }
22899}
22900impl Default for PARAM_MAP_RC_DATA {
22901 fn default() -> Self {
22902 Self::DEFAULT.clone()
22903 }
22904}
22905impl MessageData for PARAM_MAP_RC_DATA {
22906 type Message = MavMessage;
22907 const ID: u32 = 50u32;
22908 const NAME: &'static str = "PARAM_MAP_RC";
22909 const EXTRA_CRC: u8 = 78u8;
22910 const ENCODED_LEN: usize = 37usize;
22911 fn deser(
22912 _version: MavlinkVersion,
22913 __input: &[u8],
22914 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22915 let avail_len = __input.len();
22916 let mut payload_buf = [0; Self::ENCODED_LEN];
22917 let mut buf = if avail_len < Self::ENCODED_LEN {
22918 payload_buf[0..avail_len].copy_from_slice(__input);
22919 Bytes::new(&payload_buf)
22920 } else {
22921 Bytes::new(__input)
22922 };
22923 let mut __struct = Self::default();
22924 __struct.param_value0 = buf.get_f32_le();
22925 __struct.scale = buf.get_f32_le();
22926 __struct.param_value_min = buf.get_f32_le();
22927 __struct.param_value_max = buf.get_f32_le();
22928 __struct.param_index = buf.get_i16_le();
22929 __struct.target_system = buf.get_u8();
22930 __struct.target_component = buf.get_u8();
22931 for v in &mut __struct.param_id {
22932 let val = buf.get_u8();
22933 *v = val;
22934 }
22935 __struct.parameter_rc_channel_index = buf.get_u8();
22936 Ok(__struct)
22937 }
22938 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22939 let mut __tmp = BytesMut::new(bytes);
22940 #[allow(clippy::absurd_extreme_comparisons)]
22941 #[allow(unused_comparisons)]
22942 if __tmp.remaining() < Self::ENCODED_LEN {
22943 panic!(
22944 "buffer is too small (need {} bytes, but got {})",
22945 Self::ENCODED_LEN,
22946 __tmp.remaining(),
22947 )
22948 }
22949 __tmp.put_f32_le(self.param_value0);
22950 __tmp.put_f32_le(self.scale);
22951 __tmp.put_f32_le(self.param_value_min);
22952 __tmp.put_f32_le(self.param_value_max);
22953 __tmp.put_i16_le(self.param_index);
22954 __tmp.put_u8(self.target_system);
22955 __tmp.put_u8(self.target_component);
22956 for val in &self.param_id {
22957 __tmp.put_u8(*val);
22958 }
22959 __tmp.put_u8(self.parameter_rc_channel_index);
22960 if matches!(version, MavlinkVersion::V2) {
22961 let len = __tmp.len();
22962 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22963 } else {
22964 __tmp.len()
22965 }
22966 }
22967}
22968#[doc = "id: 21"]
22969#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
22970#[derive(Debug, Clone, PartialEq)]
22971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22973pub struct PARAM_REQUEST_LIST_DATA {
22974 #[doc = "System ID"]
22975 pub target_system: u8,
22976 #[doc = "Component ID"]
22977 pub target_component: u8,
22978}
22979impl PARAM_REQUEST_LIST_DATA {
22980 pub const ENCODED_LEN: usize = 2usize;
22981 pub const DEFAULT: Self = Self {
22982 target_system: 0_u8,
22983 target_component: 0_u8,
22984 };
22985 #[cfg(feature = "arbitrary")]
22986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22987 use arbitrary::{Arbitrary, Unstructured};
22988 let mut buf = [0u8; 1024];
22989 rng.fill_bytes(&mut buf);
22990 let mut unstructured = Unstructured::new(&buf);
22991 Self::arbitrary(&mut unstructured).unwrap_or_default()
22992 }
22993}
22994impl Default for PARAM_REQUEST_LIST_DATA {
22995 fn default() -> Self {
22996 Self::DEFAULT.clone()
22997 }
22998}
22999impl MessageData for PARAM_REQUEST_LIST_DATA {
23000 type Message = MavMessage;
23001 const ID: u32 = 21u32;
23002 const NAME: &'static str = "PARAM_REQUEST_LIST";
23003 const EXTRA_CRC: u8 = 159u8;
23004 const ENCODED_LEN: usize = 2usize;
23005 fn deser(
23006 _version: MavlinkVersion,
23007 __input: &[u8],
23008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23009 let avail_len = __input.len();
23010 let mut payload_buf = [0; Self::ENCODED_LEN];
23011 let mut buf = if avail_len < Self::ENCODED_LEN {
23012 payload_buf[0..avail_len].copy_from_slice(__input);
23013 Bytes::new(&payload_buf)
23014 } else {
23015 Bytes::new(__input)
23016 };
23017 let mut __struct = Self::default();
23018 __struct.target_system = buf.get_u8();
23019 __struct.target_component = buf.get_u8();
23020 Ok(__struct)
23021 }
23022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23023 let mut __tmp = BytesMut::new(bytes);
23024 #[allow(clippy::absurd_extreme_comparisons)]
23025 #[allow(unused_comparisons)]
23026 if __tmp.remaining() < Self::ENCODED_LEN {
23027 panic!(
23028 "buffer is too small (need {} bytes, but got {})",
23029 Self::ENCODED_LEN,
23030 __tmp.remaining(),
23031 )
23032 }
23033 __tmp.put_u8(self.target_system);
23034 __tmp.put_u8(self.target_component);
23035 if matches!(version, MavlinkVersion::V2) {
23036 let len = __tmp.len();
23037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23038 } else {
23039 __tmp.len()
23040 }
23041 }
23042}
23043#[doc = "id: 20"]
23044#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23045#[derive(Debug, Clone, PartialEq)]
23046#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23047#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23048pub struct PARAM_REQUEST_READ_DATA {
23049 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23050 pub param_index: i16,
23051 #[doc = "System ID"]
23052 pub target_system: u8,
23053 #[doc = "Component ID"]
23054 pub target_component: u8,
23055 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23056 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23057 pub param_id: [u8; 16],
23058}
23059impl PARAM_REQUEST_READ_DATA {
23060 pub const ENCODED_LEN: usize = 20usize;
23061 pub const DEFAULT: Self = Self {
23062 param_index: 0_i16,
23063 target_system: 0_u8,
23064 target_component: 0_u8,
23065 param_id: [0_u8; 16usize],
23066 };
23067 #[cfg(feature = "arbitrary")]
23068 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23069 use arbitrary::{Arbitrary, Unstructured};
23070 let mut buf = [0u8; 1024];
23071 rng.fill_bytes(&mut buf);
23072 let mut unstructured = Unstructured::new(&buf);
23073 Self::arbitrary(&mut unstructured).unwrap_or_default()
23074 }
23075}
23076impl Default for PARAM_REQUEST_READ_DATA {
23077 fn default() -> Self {
23078 Self::DEFAULT.clone()
23079 }
23080}
23081impl MessageData for PARAM_REQUEST_READ_DATA {
23082 type Message = MavMessage;
23083 const ID: u32 = 20u32;
23084 const NAME: &'static str = "PARAM_REQUEST_READ";
23085 const EXTRA_CRC: u8 = 214u8;
23086 const ENCODED_LEN: usize = 20usize;
23087 fn deser(
23088 _version: MavlinkVersion,
23089 __input: &[u8],
23090 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23091 let avail_len = __input.len();
23092 let mut payload_buf = [0; Self::ENCODED_LEN];
23093 let mut buf = if avail_len < Self::ENCODED_LEN {
23094 payload_buf[0..avail_len].copy_from_slice(__input);
23095 Bytes::new(&payload_buf)
23096 } else {
23097 Bytes::new(__input)
23098 };
23099 let mut __struct = Self::default();
23100 __struct.param_index = buf.get_i16_le();
23101 __struct.target_system = buf.get_u8();
23102 __struct.target_component = buf.get_u8();
23103 for v in &mut __struct.param_id {
23104 let val = buf.get_u8();
23105 *v = val;
23106 }
23107 Ok(__struct)
23108 }
23109 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23110 let mut __tmp = BytesMut::new(bytes);
23111 #[allow(clippy::absurd_extreme_comparisons)]
23112 #[allow(unused_comparisons)]
23113 if __tmp.remaining() < Self::ENCODED_LEN {
23114 panic!(
23115 "buffer is too small (need {} bytes, but got {})",
23116 Self::ENCODED_LEN,
23117 __tmp.remaining(),
23118 )
23119 }
23120 __tmp.put_i16_le(self.param_index);
23121 __tmp.put_u8(self.target_system);
23122 __tmp.put_u8(self.target_component);
23123 for val in &self.param_id {
23124 __tmp.put_u8(*val);
23125 }
23126 if matches!(version, MavlinkVersion::V2) {
23127 let len = __tmp.len();
23128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23129 } else {
23130 __tmp.len()
23131 }
23132 }
23133}
23134#[doc = "id: 23"]
23135#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23136#[derive(Debug, Clone, PartialEq)]
23137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23139pub struct PARAM_SET_DATA {
23140 #[doc = "Onboard parameter value"]
23141 pub param_value: f32,
23142 #[doc = "System ID"]
23143 pub target_system: u8,
23144 #[doc = "Component ID"]
23145 pub target_component: u8,
23146 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23147 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23148 pub param_id: [u8; 16],
23149 #[doc = "Onboard parameter type."]
23150 pub param_type: MavParamType,
23151}
23152impl PARAM_SET_DATA {
23153 pub const ENCODED_LEN: usize = 23usize;
23154 pub const DEFAULT: Self = Self {
23155 param_value: 0.0_f32,
23156 target_system: 0_u8,
23157 target_component: 0_u8,
23158 param_id: [0_u8; 16usize],
23159 param_type: MavParamType::DEFAULT,
23160 };
23161 #[cfg(feature = "arbitrary")]
23162 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23163 use arbitrary::{Arbitrary, Unstructured};
23164 let mut buf = [0u8; 1024];
23165 rng.fill_bytes(&mut buf);
23166 let mut unstructured = Unstructured::new(&buf);
23167 Self::arbitrary(&mut unstructured).unwrap_or_default()
23168 }
23169}
23170impl Default for PARAM_SET_DATA {
23171 fn default() -> Self {
23172 Self::DEFAULT.clone()
23173 }
23174}
23175impl MessageData for PARAM_SET_DATA {
23176 type Message = MavMessage;
23177 const ID: u32 = 23u32;
23178 const NAME: &'static str = "PARAM_SET";
23179 const EXTRA_CRC: u8 = 168u8;
23180 const ENCODED_LEN: usize = 23usize;
23181 fn deser(
23182 _version: MavlinkVersion,
23183 __input: &[u8],
23184 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23185 let avail_len = __input.len();
23186 let mut payload_buf = [0; Self::ENCODED_LEN];
23187 let mut buf = if avail_len < Self::ENCODED_LEN {
23188 payload_buf[0..avail_len].copy_from_slice(__input);
23189 Bytes::new(&payload_buf)
23190 } else {
23191 Bytes::new(__input)
23192 };
23193 let mut __struct = Self::default();
23194 __struct.param_value = buf.get_f32_le();
23195 __struct.target_system = buf.get_u8();
23196 __struct.target_component = buf.get_u8();
23197 for v in &mut __struct.param_id {
23198 let val = buf.get_u8();
23199 *v = val;
23200 }
23201 let tmp = buf.get_u8();
23202 __struct.param_type =
23203 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23204 enum_type: "MavParamType",
23205 value: tmp as u32,
23206 })?;
23207 Ok(__struct)
23208 }
23209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23210 let mut __tmp = BytesMut::new(bytes);
23211 #[allow(clippy::absurd_extreme_comparisons)]
23212 #[allow(unused_comparisons)]
23213 if __tmp.remaining() < Self::ENCODED_LEN {
23214 panic!(
23215 "buffer is too small (need {} bytes, but got {})",
23216 Self::ENCODED_LEN,
23217 __tmp.remaining(),
23218 )
23219 }
23220 __tmp.put_f32_le(self.param_value);
23221 __tmp.put_u8(self.target_system);
23222 __tmp.put_u8(self.target_component);
23223 for val in &self.param_id {
23224 __tmp.put_u8(*val);
23225 }
23226 __tmp.put_u8(self.param_type as u8);
23227 if matches!(version, MavlinkVersion::V2) {
23228 let len = __tmp.len();
23229 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23230 } else {
23231 __tmp.len()
23232 }
23233 }
23234}
23235#[doc = "id: 22"]
23236#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23237#[derive(Debug, Clone, PartialEq)]
23238#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23239#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23240pub struct PARAM_VALUE_DATA {
23241 #[doc = "Onboard parameter value"]
23242 pub param_value: f32,
23243 #[doc = "Total number of onboard parameters"]
23244 pub param_count: u16,
23245 #[doc = "Index of this onboard parameter"]
23246 pub param_index: u16,
23247 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23248 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23249 pub param_id: [u8; 16],
23250 #[doc = "Onboard parameter type."]
23251 pub param_type: MavParamType,
23252}
23253impl PARAM_VALUE_DATA {
23254 pub const ENCODED_LEN: usize = 25usize;
23255 pub const DEFAULT: Self = Self {
23256 param_value: 0.0_f32,
23257 param_count: 0_u16,
23258 param_index: 0_u16,
23259 param_id: [0_u8; 16usize],
23260 param_type: MavParamType::DEFAULT,
23261 };
23262 #[cfg(feature = "arbitrary")]
23263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23264 use arbitrary::{Arbitrary, Unstructured};
23265 let mut buf = [0u8; 1024];
23266 rng.fill_bytes(&mut buf);
23267 let mut unstructured = Unstructured::new(&buf);
23268 Self::arbitrary(&mut unstructured).unwrap_or_default()
23269 }
23270}
23271impl Default for PARAM_VALUE_DATA {
23272 fn default() -> Self {
23273 Self::DEFAULT.clone()
23274 }
23275}
23276impl MessageData for PARAM_VALUE_DATA {
23277 type Message = MavMessage;
23278 const ID: u32 = 22u32;
23279 const NAME: &'static str = "PARAM_VALUE";
23280 const EXTRA_CRC: u8 = 220u8;
23281 const ENCODED_LEN: usize = 25usize;
23282 fn deser(
23283 _version: MavlinkVersion,
23284 __input: &[u8],
23285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23286 let avail_len = __input.len();
23287 let mut payload_buf = [0; Self::ENCODED_LEN];
23288 let mut buf = if avail_len < Self::ENCODED_LEN {
23289 payload_buf[0..avail_len].copy_from_slice(__input);
23290 Bytes::new(&payload_buf)
23291 } else {
23292 Bytes::new(__input)
23293 };
23294 let mut __struct = Self::default();
23295 __struct.param_value = buf.get_f32_le();
23296 __struct.param_count = buf.get_u16_le();
23297 __struct.param_index = buf.get_u16_le();
23298 for v in &mut __struct.param_id {
23299 let val = buf.get_u8();
23300 *v = val;
23301 }
23302 let tmp = buf.get_u8();
23303 __struct.param_type =
23304 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23305 enum_type: "MavParamType",
23306 value: tmp as u32,
23307 })?;
23308 Ok(__struct)
23309 }
23310 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23311 let mut __tmp = BytesMut::new(bytes);
23312 #[allow(clippy::absurd_extreme_comparisons)]
23313 #[allow(unused_comparisons)]
23314 if __tmp.remaining() < Self::ENCODED_LEN {
23315 panic!(
23316 "buffer is too small (need {} bytes, but got {})",
23317 Self::ENCODED_LEN,
23318 __tmp.remaining(),
23319 )
23320 }
23321 __tmp.put_f32_le(self.param_value);
23322 __tmp.put_u16_le(self.param_count);
23323 __tmp.put_u16_le(self.param_index);
23324 for val in &self.param_id {
23325 __tmp.put_u8(*val);
23326 }
23327 __tmp.put_u8(self.param_type as u8);
23328 if matches!(version, MavlinkVersion::V2) {
23329 let len = __tmp.len();
23330 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23331 } else {
23332 __tmp.len()
23333 }
23334 }
23335}
23336#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23337#[doc = "id: 4"]
23338#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23339#[derive(Debug, Clone, PartialEq)]
23340#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23342pub struct PING_DATA {
23343 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23344 pub time_usec: u64,
23345 #[doc = "PING sequence"]
23346 pub seq: u32,
23347 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23348 pub target_system: u8,
23349 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23350 pub target_component: u8,
23351}
23352impl PING_DATA {
23353 pub const ENCODED_LEN: usize = 14usize;
23354 pub const DEFAULT: Self = Self {
23355 time_usec: 0_u64,
23356 seq: 0_u32,
23357 target_system: 0_u8,
23358 target_component: 0_u8,
23359 };
23360 #[cfg(feature = "arbitrary")]
23361 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23362 use arbitrary::{Arbitrary, Unstructured};
23363 let mut buf = [0u8; 1024];
23364 rng.fill_bytes(&mut buf);
23365 let mut unstructured = Unstructured::new(&buf);
23366 Self::arbitrary(&mut unstructured).unwrap_or_default()
23367 }
23368}
23369impl Default for PING_DATA {
23370 fn default() -> Self {
23371 Self::DEFAULT.clone()
23372 }
23373}
23374impl MessageData for PING_DATA {
23375 type Message = MavMessage;
23376 const ID: u32 = 4u32;
23377 const NAME: &'static str = "PING";
23378 const EXTRA_CRC: u8 = 237u8;
23379 const ENCODED_LEN: usize = 14usize;
23380 fn deser(
23381 _version: MavlinkVersion,
23382 __input: &[u8],
23383 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23384 let avail_len = __input.len();
23385 let mut payload_buf = [0; Self::ENCODED_LEN];
23386 let mut buf = if avail_len < Self::ENCODED_LEN {
23387 payload_buf[0..avail_len].copy_from_slice(__input);
23388 Bytes::new(&payload_buf)
23389 } else {
23390 Bytes::new(__input)
23391 };
23392 let mut __struct = Self::default();
23393 __struct.time_usec = buf.get_u64_le();
23394 __struct.seq = buf.get_u32_le();
23395 __struct.target_system = buf.get_u8();
23396 __struct.target_component = buf.get_u8();
23397 Ok(__struct)
23398 }
23399 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23400 let mut __tmp = BytesMut::new(bytes);
23401 #[allow(clippy::absurd_extreme_comparisons)]
23402 #[allow(unused_comparisons)]
23403 if __tmp.remaining() < Self::ENCODED_LEN {
23404 panic!(
23405 "buffer is too small (need {} bytes, but got {})",
23406 Self::ENCODED_LEN,
23407 __tmp.remaining(),
23408 )
23409 }
23410 __tmp.put_u64_le(self.time_usec);
23411 __tmp.put_u32_le(self.seq);
23412 __tmp.put_u8(self.target_system);
23413 __tmp.put_u8(self.target_component);
23414 if matches!(version, MavlinkVersion::V2) {
23415 let len = __tmp.len();
23416 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23417 } else {
23418 __tmp.len()
23419 }
23420 }
23421}
23422#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23423#[doc = "id: 258"]
23424#[doc = "Control vehicle tone generation (buzzer)."]
23425#[derive(Debug, Clone, PartialEq)]
23426#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23427#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23428pub struct PLAY_TUNE_DATA {
23429 #[doc = "System ID"]
23430 pub target_system: u8,
23431 #[doc = "Component ID"]
23432 pub target_component: u8,
23433 #[doc = "tune in board specific format"]
23434 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23435 pub tune: [u8; 30],
23436 #[doc = "tune extension (appended to tune)"]
23437 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23439 pub tune2: [u8; 200],
23440}
23441impl PLAY_TUNE_DATA {
23442 pub const ENCODED_LEN: usize = 232usize;
23443 pub const DEFAULT: Self = Self {
23444 target_system: 0_u8,
23445 target_component: 0_u8,
23446 tune: [0_u8; 30usize],
23447 tune2: [0_u8; 200usize],
23448 };
23449 #[cfg(feature = "arbitrary")]
23450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23451 use arbitrary::{Arbitrary, Unstructured};
23452 let mut buf = [0u8; 1024];
23453 rng.fill_bytes(&mut buf);
23454 let mut unstructured = Unstructured::new(&buf);
23455 Self::arbitrary(&mut unstructured).unwrap_or_default()
23456 }
23457}
23458impl Default for PLAY_TUNE_DATA {
23459 fn default() -> Self {
23460 Self::DEFAULT.clone()
23461 }
23462}
23463impl MessageData for PLAY_TUNE_DATA {
23464 type Message = MavMessage;
23465 const ID: u32 = 258u32;
23466 const NAME: &'static str = "PLAY_TUNE";
23467 const EXTRA_CRC: u8 = 187u8;
23468 const ENCODED_LEN: usize = 232usize;
23469 fn deser(
23470 _version: MavlinkVersion,
23471 __input: &[u8],
23472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23473 let avail_len = __input.len();
23474 let mut payload_buf = [0; Self::ENCODED_LEN];
23475 let mut buf = if avail_len < Self::ENCODED_LEN {
23476 payload_buf[0..avail_len].copy_from_slice(__input);
23477 Bytes::new(&payload_buf)
23478 } else {
23479 Bytes::new(__input)
23480 };
23481 let mut __struct = Self::default();
23482 __struct.target_system = buf.get_u8();
23483 __struct.target_component = buf.get_u8();
23484 for v in &mut __struct.tune {
23485 let val = buf.get_u8();
23486 *v = val;
23487 }
23488 for v in &mut __struct.tune2 {
23489 let val = buf.get_u8();
23490 *v = val;
23491 }
23492 Ok(__struct)
23493 }
23494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23495 let mut __tmp = BytesMut::new(bytes);
23496 #[allow(clippy::absurd_extreme_comparisons)]
23497 #[allow(unused_comparisons)]
23498 if __tmp.remaining() < Self::ENCODED_LEN {
23499 panic!(
23500 "buffer is too small (need {} bytes, but got {})",
23501 Self::ENCODED_LEN,
23502 __tmp.remaining(),
23503 )
23504 }
23505 __tmp.put_u8(self.target_system);
23506 __tmp.put_u8(self.target_component);
23507 for val in &self.tune {
23508 __tmp.put_u8(*val);
23509 }
23510 for val in &self.tune2 {
23511 __tmp.put_u8(*val);
23512 }
23513 if matches!(version, MavlinkVersion::V2) {
23514 let len = __tmp.len();
23515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23516 } else {
23517 __tmp.len()
23518 }
23519 }
23520}
23521#[doc = "id: 400"]
23522#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23523#[derive(Debug, Clone, PartialEq)]
23524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23526pub struct PLAY_TUNE_V2_DATA {
23527 #[doc = "Tune format"]
23528 pub format: TuneFormat,
23529 #[doc = "System ID"]
23530 pub target_system: u8,
23531 #[doc = "Component ID"]
23532 pub target_component: u8,
23533 #[doc = "Tune definition as a NULL-terminated string."]
23534 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23535 pub tune: [u8; 248],
23536}
23537impl PLAY_TUNE_V2_DATA {
23538 pub const ENCODED_LEN: usize = 254usize;
23539 pub const DEFAULT: Self = Self {
23540 format: TuneFormat::DEFAULT,
23541 target_system: 0_u8,
23542 target_component: 0_u8,
23543 tune: [0_u8; 248usize],
23544 };
23545 #[cfg(feature = "arbitrary")]
23546 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23547 use arbitrary::{Arbitrary, Unstructured};
23548 let mut buf = [0u8; 1024];
23549 rng.fill_bytes(&mut buf);
23550 let mut unstructured = Unstructured::new(&buf);
23551 Self::arbitrary(&mut unstructured).unwrap_or_default()
23552 }
23553}
23554impl Default for PLAY_TUNE_V2_DATA {
23555 fn default() -> Self {
23556 Self::DEFAULT.clone()
23557 }
23558}
23559impl MessageData for PLAY_TUNE_V2_DATA {
23560 type Message = MavMessage;
23561 const ID: u32 = 400u32;
23562 const NAME: &'static str = "PLAY_TUNE_V2";
23563 const EXTRA_CRC: u8 = 110u8;
23564 const ENCODED_LEN: usize = 254usize;
23565 fn deser(
23566 _version: MavlinkVersion,
23567 __input: &[u8],
23568 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23569 let avail_len = __input.len();
23570 let mut payload_buf = [0; Self::ENCODED_LEN];
23571 let mut buf = if avail_len < Self::ENCODED_LEN {
23572 payload_buf[0..avail_len].copy_from_slice(__input);
23573 Bytes::new(&payload_buf)
23574 } else {
23575 Bytes::new(__input)
23576 };
23577 let mut __struct = Self::default();
23578 let tmp = buf.get_u32_le();
23579 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
23580 ::mavlink_core::error::ParserError::InvalidEnum {
23581 enum_type: "TuneFormat",
23582 value: tmp as u32,
23583 },
23584 )?;
23585 __struct.target_system = buf.get_u8();
23586 __struct.target_component = buf.get_u8();
23587 for v in &mut __struct.tune {
23588 let val = buf.get_u8();
23589 *v = val;
23590 }
23591 Ok(__struct)
23592 }
23593 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23594 let mut __tmp = BytesMut::new(bytes);
23595 #[allow(clippy::absurd_extreme_comparisons)]
23596 #[allow(unused_comparisons)]
23597 if __tmp.remaining() < Self::ENCODED_LEN {
23598 panic!(
23599 "buffer is too small (need {} bytes, but got {})",
23600 Self::ENCODED_LEN,
23601 __tmp.remaining(),
23602 )
23603 }
23604 __tmp.put_u32_le(self.format as u32);
23605 __tmp.put_u8(self.target_system);
23606 __tmp.put_u8(self.target_component);
23607 for val in &self.tune {
23608 __tmp.put_u8(*val);
23609 }
23610 if matches!(version, MavlinkVersion::V2) {
23611 let len = __tmp.len();
23612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23613 } else {
23614 __tmp.len()
23615 }
23616 }
23617}
23618#[doc = "id: 87"]
23619#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
23620#[derive(Debug, Clone, PartialEq)]
23621#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23623pub struct POSITION_TARGET_GLOBAL_INT_DATA {
23624 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
23625 pub time_boot_ms: u32,
23626 #[doc = "Latitude in WGS84 frame"]
23627 pub lat_int: i32,
23628 #[doc = "Longitude in WGS84 frame"]
23629 pub lon_int: i32,
23630 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
23631 pub alt: f32,
23632 #[doc = "X velocity in NED frame"]
23633 pub vx: f32,
23634 #[doc = "Y velocity in NED frame"]
23635 pub vy: f32,
23636 #[doc = "Z velocity in NED frame"]
23637 pub vz: f32,
23638 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23639 pub afx: f32,
23640 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23641 pub afy: f32,
23642 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23643 pub afz: f32,
23644 #[doc = "yaw setpoint"]
23645 pub yaw: f32,
23646 #[doc = "yaw rate setpoint"]
23647 pub yaw_rate: f32,
23648 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23649 pub type_mask: PositionTargetTypemask,
23650 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
23651 pub coordinate_frame: MavFrame,
23652}
23653impl POSITION_TARGET_GLOBAL_INT_DATA {
23654 pub const ENCODED_LEN: usize = 51usize;
23655 pub const DEFAULT: Self = Self {
23656 time_boot_ms: 0_u32,
23657 lat_int: 0_i32,
23658 lon_int: 0_i32,
23659 alt: 0.0_f32,
23660 vx: 0.0_f32,
23661 vy: 0.0_f32,
23662 vz: 0.0_f32,
23663 afx: 0.0_f32,
23664 afy: 0.0_f32,
23665 afz: 0.0_f32,
23666 yaw: 0.0_f32,
23667 yaw_rate: 0.0_f32,
23668 type_mask: PositionTargetTypemask::DEFAULT,
23669 coordinate_frame: MavFrame::DEFAULT,
23670 };
23671 #[cfg(feature = "arbitrary")]
23672 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23673 use arbitrary::{Arbitrary, Unstructured};
23674 let mut buf = [0u8; 1024];
23675 rng.fill_bytes(&mut buf);
23676 let mut unstructured = Unstructured::new(&buf);
23677 Self::arbitrary(&mut unstructured).unwrap_or_default()
23678 }
23679}
23680impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
23681 fn default() -> Self {
23682 Self::DEFAULT.clone()
23683 }
23684}
23685impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
23686 type Message = MavMessage;
23687 const ID: u32 = 87u32;
23688 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
23689 const EXTRA_CRC: u8 = 150u8;
23690 const ENCODED_LEN: usize = 51usize;
23691 fn deser(
23692 _version: MavlinkVersion,
23693 __input: &[u8],
23694 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23695 let avail_len = __input.len();
23696 let mut payload_buf = [0; Self::ENCODED_LEN];
23697 let mut buf = if avail_len < Self::ENCODED_LEN {
23698 payload_buf[0..avail_len].copy_from_slice(__input);
23699 Bytes::new(&payload_buf)
23700 } else {
23701 Bytes::new(__input)
23702 };
23703 let mut __struct = Self::default();
23704 __struct.time_boot_ms = buf.get_u32_le();
23705 __struct.lat_int = buf.get_i32_le();
23706 __struct.lon_int = buf.get_i32_le();
23707 __struct.alt = buf.get_f32_le();
23708 __struct.vx = buf.get_f32_le();
23709 __struct.vy = buf.get_f32_le();
23710 __struct.vz = buf.get_f32_le();
23711 __struct.afx = buf.get_f32_le();
23712 __struct.afy = buf.get_f32_le();
23713 __struct.afz = buf.get_f32_le();
23714 __struct.yaw = buf.get_f32_le();
23715 __struct.yaw_rate = buf.get_f32_le();
23716 let tmp = buf.get_u16_le();
23717 __struct.type_mask = PositionTargetTypemask::from_bits(
23718 tmp & PositionTargetTypemask::all().bits(),
23719 )
23720 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23721 flag_type: "PositionTargetTypemask",
23722 value: tmp as u32,
23723 })?;
23724 let tmp = buf.get_u8();
23725 __struct.coordinate_frame =
23726 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23727 enum_type: "MavFrame",
23728 value: tmp as u32,
23729 })?;
23730 Ok(__struct)
23731 }
23732 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23733 let mut __tmp = BytesMut::new(bytes);
23734 #[allow(clippy::absurd_extreme_comparisons)]
23735 #[allow(unused_comparisons)]
23736 if __tmp.remaining() < Self::ENCODED_LEN {
23737 panic!(
23738 "buffer is too small (need {} bytes, but got {})",
23739 Self::ENCODED_LEN,
23740 __tmp.remaining(),
23741 )
23742 }
23743 __tmp.put_u32_le(self.time_boot_ms);
23744 __tmp.put_i32_le(self.lat_int);
23745 __tmp.put_i32_le(self.lon_int);
23746 __tmp.put_f32_le(self.alt);
23747 __tmp.put_f32_le(self.vx);
23748 __tmp.put_f32_le(self.vy);
23749 __tmp.put_f32_le(self.vz);
23750 __tmp.put_f32_le(self.afx);
23751 __tmp.put_f32_le(self.afy);
23752 __tmp.put_f32_le(self.afz);
23753 __tmp.put_f32_le(self.yaw);
23754 __tmp.put_f32_le(self.yaw_rate);
23755 __tmp.put_u16_le(self.type_mask.bits());
23756 __tmp.put_u8(self.coordinate_frame as u8);
23757 if matches!(version, MavlinkVersion::V2) {
23758 let len = __tmp.len();
23759 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23760 } else {
23761 __tmp.len()
23762 }
23763 }
23764}
23765#[doc = "id: 85"]
23766#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
23767#[derive(Debug, Clone, PartialEq)]
23768#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23769#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23770pub struct POSITION_TARGET_LOCAL_NED_DATA {
23771 #[doc = "Timestamp (time since system boot)."]
23772 pub time_boot_ms: u32,
23773 #[doc = "X Position in NED frame"]
23774 pub x: f32,
23775 #[doc = "Y Position in NED frame"]
23776 pub y: f32,
23777 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
23778 pub z: f32,
23779 #[doc = "X velocity in NED frame"]
23780 pub vx: f32,
23781 #[doc = "Y velocity in NED frame"]
23782 pub vy: f32,
23783 #[doc = "Z velocity in NED frame"]
23784 pub vz: f32,
23785 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23786 pub afx: f32,
23787 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23788 pub afy: f32,
23789 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
23790 pub afz: f32,
23791 #[doc = "yaw setpoint"]
23792 pub yaw: f32,
23793 #[doc = "yaw rate setpoint"]
23794 pub yaw_rate: f32,
23795 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
23796 pub type_mask: PositionTargetTypemask,
23797 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
23798 pub coordinate_frame: MavFrame,
23799}
23800impl POSITION_TARGET_LOCAL_NED_DATA {
23801 pub const ENCODED_LEN: usize = 51usize;
23802 pub const DEFAULT: Self = Self {
23803 time_boot_ms: 0_u32,
23804 x: 0.0_f32,
23805 y: 0.0_f32,
23806 z: 0.0_f32,
23807 vx: 0.0_f32,
23808 vy: 0.0_f32,
23809 vz: 0.0_f32,
23810 afx: 0.0_f32,
23811 afy: 0.0_f32,
23812 afz: 0.0_f32,
23813 yaw: 0.0_f32,
23814 yaw_rate: 0.0_f32,
23815 type_mask: PositionTargetTypemask::DEFAULT,
23816 coordinate_frame: MavFrame::DEFAULT,
23817 };
23818 #[cfg(feature = "arbitrary")]
23819 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23820 use arbitrary::{Arbitrary, Unstructured};
23821 let mut buf = [0u8; 1024];
23822 rng.fill_bytes(&mut buf);
23823 let mut unstructured = Unstructured::new(&buf);
23824 Self::arbitrary(&mut unstructured).unwrap_or_default()
23825 }
23826}
23827impl Default for POSITION_TARGET_LOCAL_NED_DATA {
23828 fn default() -> Self {
23829 Self::DEFAULT.clone()
23830 }
23831}
23832impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
23833 type Message = MavMessage;
23834 const ID: u32 = 85u32;
23835 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
23836 const EXTRA_CRC: u8 = 140u8;
23837 const ENCODED_LEN: usize = 51usize;
23838 fn deser(
23839 _version: MavlinkVersion,
23840 __input: &[u8],
23841 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23842 let avail_len = __input.len();
23843 let mut payload_buf = [0; Self::ENCODED_LEN];
23844 let mut buf = if avail_len < Self::ENCODED_LEN {
23845 payload_buf[0..avail_len].copy_from_slice(__input);
23846 Bytes::new(&payload_buf)
23847 } else {
23848 Bytes::new(__input)
23849 };
23850 let mut __struct = Self::default();
23851 __struct.time_boot_ms = buf.get_u32_le();
23852 __struct.x = buf.get_f32_le();
23853 __struct.y = buf.get_f32_le();
23854 __struct.z = buf.get_f32_le();
23855 __struct.vx = buf.get_f32_le();
23856 __struct.vy = buf.get_f32_le();
23857 __struct.vz = buf.get_f32_le();
23858 __struct.afx = buf.get_f32_le();
23859 __struct.afy = buf.get_f32_le();
23860 __struct.afz = buf.get_f32_le();
23861 __struct.yaw = buf.get_f32_le();
23862 __struct.yaw_rate = buf.get_f32_le();
23863 let tmp = buf.get_u16_le();
23864 __struct.type_mask = PositionTargetTypemask::from_bits(
23865 tmp & PositionTargetTypemask::all().bits(),
23866 )
23867 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23868 flag_type: "PositionTargetTypemask",
23869 value: tmp as u32,
23870 })?;
23871 let tmp = buf.get_u8();
23872 __struct.coordinate_frame =
23873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23874 enum_type: "MavFrame",
23875 value: tmp as u32,
23876 })?;
23877 Ok(__struct)
23878 }
23879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23880 let mut __tmp = BytesMut::new(bytes);
23881 #[allow(clippy::absurd_extreme_comparisons)]
23882 #[allow(unused_comparisons)]
23883 if __tmp.remaining() < Self::ENCODED_LEN {
23884 panic!(
23885 "buffer is too small (need {} bytes, but got {})",
23886 Self::ENCODED_LEN,
23887 __tmp.remaining(),
23888 )
23889 }
23890 __tmp.put_u32_le(self.time_boot_ms);
23891 __tmp.put_f32_le(self.x);
23892 __tmp.put_f32_le(self.y);
23893 __tmp.put_f32_le(self.z);
23894 __tmp.put_f32_le(self.vx);
23895 __tmp.put_f32_le(self.vy);
23896 __tmp.put_f32_le(self.vz);
23897 __tmp.put_f32_le(self.afx);
23898 __tmp.put_f32_le(self.afy);
23899 __tmp.put_f32_le(self.afz);
23900 __tmp.put_f32_le(self.yaw);
23901 __tmp.put_f32_le(self.yaw_rate);
23902 __tmp.put_u16_le(self.type_mask.bits());
23903 __tmp.put_u8(self.coordinate_frame as u8);
23904 if matches!(version, MavlinkVersion::V2) {
23905 let len = __tmp.len();
23906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23907 } else {
23908 __tmp.len()
23909 }
23910 }
23911}
23912#[doc = "id: 125"]
23913#[doc = "Power supply status."]
23914#[derive(Debug, Clone, PartialEq)]
23915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23917pub struct POWER_STATUS_DATA {
23918 #[doc = "5V rail voltage."]
23919 pub Vcc: u16,
23920 #[doc = "Servo rail voltage."]
23921 pub Vservo: u16,
23922 #[doc = "Bitmap of power supply status flags."]
23923 pub flags: MavPowerStatus,
23924}
23925impl POWER_STATUS_DATA {
23926 pub const ENCODED_LEN: usize = 6usize;
23927 pub const DEFAULT: Self = Self {
23928 Vcc: 0_u16,
23929 Vservo: 0_u16,
23930 flags: MavPowerStatus::DEFAULT,
23931 };
23932 #[cfg(feature = "arbitrary")]
23933 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23934 use arbitrary::{Arbitrary, Unstructured};
23935 let mut buf = [0u8; 1024];
23936 rng.fill_bytes(&mut buf);
23937 let mut unstructured = Unstructured::new(&buf);
23938 Self::arbitrary(&mut unstructured).unwrap_or_default()
23939 }
23940}
23941impl Default for POWER_STATUS_DATA {
23942 fn default() -> Self {
23943 Self::DEFAULT.clone()
23944 }
23945}
23946impl MessageData for POWER_STATUS_DATA {
23947 type Message = MavMessage;
23948 const ID: u32 = 125u32;
23949 const NAME: &'static str = "POWER_STATUS";
23950 const EXTRA_CRC: u8 = 203u8;
23951 const ENCODED_LEN: usize = 6usize;
23952 fn deser(
23953 _version: MavlinkVersion,
23954 __input: &[u8],
23955 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23956 let avail_len = __input.len();
23957 let mut payload_buf = [0; Self::ENCODED_LEN];
23958 let mut buf = if avail_len < Self::ENCODED_LEN {
23959 payload_buf[0..avail_len].copy_from_slice(__input);
23960 Bytes::new(&payload_buf)
23961 } else {
23962 Bytes::new(__input)
23963 };
23964 let mut __struct = Self::default();
23965 __struct.Vcc = buf.get_u16_le();
23966 __struct.Vservo = buf.get_u16_le();
23967 let tmp = buf.get_u16_le();
23968 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
23969 ::mavlink_core::error::ParserError::InvalidFlag {
23970 flag_type: "MavPowerStatus",
23971 value: tmp as u32,
23972 },
23973 )?;
23974 Ok(__struct)
23975 }
23976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23977 let mut __tmp = BytesMut::new(bytes);
23978 #[allow(clippy::absurd_extreme_comparisons)]
23979 #[allow(unused_comparisons)]
23980 if __tmp.remaining() < Self::ENCODED_LEN {
23981 panic!(
23982 "buffer is too small (need {} bytes, but got {})",
23983 Self::ENCODED_LEN,
23984 __tmp.remaining(),
23985 )
23986 }
23987 __tmp.put_u16_le(self.Vcc);
23988 __tmp.put_u16_le(self.Vservo);
23989 __tmp.put_u16_le(self.flags.bits());
23990 if matches!(version, MavlinkVersion::V2) {
23991 let len = __tmp.len();
23992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23993 } else {
23994 __tmp.len()
23995 }
23996 }
23997}
23998#[doc = "id: 300"]
23999#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24000#[derive(Debug, Clone, PartialEq)]
24001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24003pub struct PROTOCOL_VERSION_DATA {
24004 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24005 pub version: u16,
24006 #[doc = "Minimum MAVLink version supported"]
24007 pub min_version: u16,
24008 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24009 pub max_version: u16,
24010 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24012 pub spec_version_hash: [u8; 8],
24013 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24014 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24015 pub library_version_hash: [u8; 8],
24016}
24017impl PROTOCOL_VERSION_DATA {
24018 pub const ENCODED_LEN: usize = 22usize;
24019 pub const DEFAULT: Self = Self {
24020 version: 0_u16,
24021 min_version: 0_u16,
24022 max_version: 0_u16,
24023 spec_version_hash: [0_u8; 8usize],
24024 library_version_hash: [0_u8; 8usize],
24025 };
24026 #[cfg(feature = "arbitrary")]
24027 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24028 use arbitrary::{Arbitrary, Unstructured};
24029 let mut buf = [0u8; 1024];
24030 rng.fill_bytes(&mut buf);
24031 let mut unstructured = Unstructured::new(&buf);
24032 Self::arbitrary(&mut unstructured).unwrap_or_default()
24033 }
24034}
24035impl Default for PROTOCOL_VERSION_DATA {
24036 fn default() -> Self {
24037 Self::DEFAULT.clone()
24038 }
24039}
24040impl MessageData for PROTOCOL_VERSION_DATA {
24041 type Message = MavMessage;
24042 const ID: u32 = 300u32;
24043 const NAME: &'static str = "PROTOCOL_VERSION";
24044 const EXTRA_CRC: u8 = 217u8;
24045 const ENCODED_LEN: usize = 22usize;
24046 fn deser(
24047 _version: MavlinkVersion,
24048 __input: &[u8],
24049 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24050 let avail_len = __input.len();
24051 let mut payload_buf = [0; Self::ENCODED_LEN];
24052 let mut buf = if avail_len < Self::ENCODED_LEN {
24053 payload_buf[0..avail_len].copy_from_slice(__input);
24054 Bytes::new(&payload_buf)
24055 } else {
24056 Bytes::new(__input)
24057 };
24058 let mut __struct = Self::default();
24059 __struct.version = buf.get_u16_le();
24060 __struct.min_version = buf.get_u16_le();
24061 __struct.max_version = buf.get_u16_le();
24062 for v in &mut __struct.spec_version_hash {
24063 let val = buf.get_u8();
24064 *v = val;
24065 }
24066 for v in &mut __struct.library_version_hash {
24067 let val = buf.get_u8();
24068 *v = val;
24069 }
24070 Ok(__struct)
24071 }
24072 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24073 let mut __tmp = BytesMut::new(bytes);
24074 #[allow(clippy::absurd_extreme_comparisons)]
24075 #[allow(unused_comparisons)]
24076 if __tmp.remaining() < Self::ENCODED_LEN {
24077 panic!(
24078 "buffer is too small (need {} bytes, but got {})",
24079 Self::ENCODED_LEN,
24080 __tmp.remaining(),
24081 )
24082 }
24083 __tmp.put_u16_le(self.version);
24084 __tmp.put_u16_le(self.min_version);
24085 __tmp.put_u16_le(self.max_version);
24086 for val in &self.spec_version_hash {
24087 __tmp.put_u8(*val);
24088 }
24089 for val in &self.library_version_hash {
24090 __tmp.put_u8(*val);
24091 }
24092 if matches!(version, MavlinkVersion::V2) {
24093 let len = __tmp.len();
24094 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24095 } else {
24096 __tmp.len()
24097 }
24098 }
24099}
24100#[doc = "id: 109"]
24101#[doc = "Status generated by radio and injected into MAVLink stream."]
24102#[derive(Debug, Clone, PartialEq)]
24103#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24104#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24105pub struct RADIO_STATUS_DATA {
24106 #[doc = "Count of radio packet receive errors (since boot)."]
24107 pub rxerrors: u16,
24108 #[doc = "Count of error corrected radio packets (since boot)."]
24109 pub fixed: u16,
24110 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24111 pub rssi: u8,
24112 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24113 pub remrssi: u8,
24114 #[doc = "Remaining free transmitter buffer space."]
24115 pub txbuf: u8,
24116 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24117 pub noise: u8,
24118 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24119 pub remnoise: u8,
24120}
24121impl RADIO_STATUS_DATA {
24122 pub const ENCODED_LEN: usize = 9usize;
24123 pub const DEFAULT: Self = Self {
24124 rxerrors: 0_u16,
24125 fixed: 0_u16,
24126 rssi: 0_u8,
24127 remrssi: 0_u8,
24128 txbuf: 0_u8,
24129 noise: 0_u8,
24130 remnoise: 0_u8,
24131 };
24132 #[cfg(feature = "arbitrary")]
24133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24134 use arbitrary::{Arbitrary, Unstructured};
24135 let mut buf = [0u8; 1024];
24136 rng.fill_bytes(&mut buf);
24137 let mut unstructured = Unstructured::new(&buf);
24138 Self::arbitrary(&mut unstructured).unwrap_or_default()
24139 }
24140}
24141impl Default for RADIO_STATUS_DATA {
24142 fn default() -> Self {
24143 Self::DEFAULT.clone()
24144 }
24145}
24146impl MessageData for RADIO_STATUS_DATA {
24147 type Message = MavMessage;
24148 const ID: u32 = 109u32;
24149 const NAME: &'static str = "RADIO_STATUS";
24150 const EXTRA_CRC: u8 = 185u8;
24151 const ENCODED_LEN: usize = 9usize;
24152 fn deser(
24153 _version: MavlinkVersion,
24154 __input: &[u8],
24155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24156 let avail_len = __input.len();
24157 let mut payload_buf = [0; Self::ENCODED_LEN];
24158 let mut buf = if avail_len < Self::ENCODED_LEN {
24159 payload_buf[0..avail_len].copy_from_slice(__input);
24160 Bytes::new(&payload_buf)
24161 } else {
24162 Bytes::new(__input)
24163 };
24164 let mut __struct = Self::default();
24165 __struct.rxerrors = buf.get_u16_le();
24166 __struct.fixed = buf.get_u16_le();
24167 __struct.rssi = buf.get_u8();
24168 __struct.remrssi = buf.get_u8();
24169 __struct.txbuf = buf.get_u8();
24170 __struct.noise = buf.get_u8();
24171 __struct.remnoise = buf.get_u8();
24172 Ok(__struct)
24173 }
24174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24175 let mut __tmp = BytesMut::new(bytes);
24176 #[allow(clippy::absurd_extreme_comparisons)]
24177 #[allow(unused_comparisons)]
24178 if __tmp.remaining() < Self::ENCODED_LEN {
24179 panic!(
24180 "buffer is too small (need {} bytes, but got {})",
24181 Self::ENCODED_LEN,
24182 __tmp.remaining(),
24183 )
24184 }
24185 __tmp.put_u16_le(self.rxerrors);
24186 __tmp.put_u16_le(self.fixed);
24187 __tmp.put_u8(self.rssi);
24188 __tmp.put_u8(self.remrssi);
24189 __tmp.put_u8(self.txbuf);
24190 __tmp.put_u8(self.noise);
24191 __tmp.put_u8(self.remnoise);
24192 if matches!(version, MavlinkVersion::V2) {
24193 let len = __tmp.len();
24194 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24195 } else {
24196 __tmp.len()
24197 }
24198 }
24199}
24200#[doc = "id: 27"]
24201#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24202#[derive(Debug, Clone, PartialEq)]
24203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24205pub struct RAW_IMU_DATA {
24206 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24207 pub time_usec: u64,
24208 #[doc = "X acceleration (raw)"]
24209 pub xacc: i16,
24210 #[doc = "Y acceleration (raw)"]
24211 pub yacc: i16,
24212 #[doc = "Z acceleration (raw)"]
24213 pub zacc: i16,
24214 #[doc = "Angular speed around X axis (raw)"]
24215 pub xgyro: i16,
24216 #[doc = "Angular speed around Y axis (raw)"]
24217 pub ygyro: i16,
24218 #[doc = "Angular speed around Z axis (raw)"]
24219 pub zgyro: i16,
24220 #[doc = "X Magnetic field (raw)"]
24221 pub xmag: i16,
24222 #[doc = "Y Magnetic field (raw)"]
24223 pub ymag: i16,
24224 #[doc = "Z Magnetic field (raw)"]
24225 pub zmag: i16,
24226 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24227 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24228 pub id: u8,
24229 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24230 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24231 pub temperature: i16,
24232}
24233impl RAW_IMU_DATA {
24234 pub const ENCODED_LEN: usize = 29usize;
24235 pub const DEFAULT: Self = Self {
24236 time_usec: 0_u64,
24237 xacc: 0_i16,
24238 yacc: 0_i16,
24239 zacc: 0_i16,
24240 xgyro: 0_i16,
24241 ygyro: 0_i16,
24242 zgyro: 0_i16,
24243 xmag: 0_i16,
24244 ymag: 0_i16,
24245 zmag: 0_i16,
24246 id: 0_u8,
24247 temperature: 0_i16,
24248 };
24249 #[cfg(feature = "arbitrary")]
24250 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24251 use arbitrary::{Arbitrary, Unstructured};
24252 let mut buf = [0u8; 1024];
24253 rng.fill_bytes(&mut buf);
24254 let mut unstructured = Unstructured::new(&buf);
24255 Self::arbitrary(&mut unstructured).unwrap_or_default()
24256 }
24257}
24258impl Default for RAW_IMU_DATA {
24259 fn default() -> Self {
24260 Self::DEFAULT.clone()
24261 }
24262}
24263impl MessageData for RAW_IMU_DATA {
24264 type Message = MavMessage;
24265 const ID: u32 = 27u32;
24266 const NAME: &'static str = "RAW_IMU";
24267 const EXTRA_CRC: u8 = 144u8;
24268 const ENCODED_LEN: usize = 29usize;
24269 fn deser(
24270 _version: MavlinkVersion,
24271 __input: &[u8],
24272 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24273 let avail_len = __input.len();
24274 let mut payload_buf = [0; Self::ENCODED_LEN];
24275 let mut buf = if avail_len < Self::ENCODED_LEN {
24276 payload_buf[0..avail_len].copy_from_slice(__input);
24277 Bytes::new(&payload_buf)
24278 } else {
24279 Bytes::new(__input)
24280 };
24281 let mut __struct = Self::default();
24282 __struct.time_usec = buf.get_u64_le();
24283 __struct.xacc = buf.get_i16_le();
24284 __struct.yacc = buf.get_i16_le();
24285 __struct.zacc = buf.get_i16_le();
24286 __struct.xgyro = buf.get_i16_le();
24287 __struct.ygyro = buf.get_i16_le();
24288 __struct.zgyro = buf.get_i16_le();
24289 __struct.xmag = buf.get_i16_le();
24290 __struct.ymag = buf.get_i16_le();
24291 __struct.zmag = buf.get_i16_le();
24292 __struct.id = buf.get_u8();
24293 __struct.temperature = buf.get_i16_le();
24294 Ok(__struct)
24295 }
24296 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24297 let mut __tmp = BytesMut::new(bytes);
24298 #[allow(clippy::absurd_extreme_comparisons)]
24299 #[allow(unused_comparisons)]
24300 if __tmp.remaining() < Self::ENCODED_LEN {
24301 panic!(
24302 "buffer is too small (need {} bytes, but got {})",
24303 Self::ENCODED_LEN,
24304 __tmp.remaining(),
24305 )
24306 }
24307 __tmp.put_u64_le(self.time_usec);
24308 __tmp.put_i16_le(self.xacc);
24309 __tmp.put_i16_le(self.yacc);
24310 __tmp.put_i16_le(self.zacc);
24311 __tmp.put_i16_le(self.xgyro);
24312 __tmp.put_i16_le(self.ygyro);
24313 __tmp.put_i16_le(self.zgyro);
24314 __tmp.put_i16_le(self.xmag);
24315 __tmp.put_i16_le(self.ymag);
24316 __tmp.put_i16_le(self.zmag);
24317 __tmp.put_u8(self.id);
24318 __tmp.put_i16_le(self.temperature);
24319 if matches!(version, MavlinkVersion::V2) {
24320 let len = __tmp.len();
24321 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24322 } else {
24323 __tmp.len()
24324 }
24325 }
24326}
24327#[doc = "id: 28"]
24328#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24329#[derive(Debug, Clone, PartialEq)]
24330#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24331#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24332pub struct RAW_PRESSURE_DATA {
24333 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24334 pub time_usec: u64,
24335 #[doc = "Absolute pressure (raw)"]
24336 pub press_abs: i16,
24337 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24338 pub press_diff1: i16,
24339 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24340 pub press_diff2: i16,
24341 #[doc = "Raw Temperature measurement (raw)"]
24342 pub temperature: i16,
24343}
24344impl RAW_PRESSURE_DATA {
24345 pub const ENCODED_LEN: usize = 16usize;
24346 pub const DEFAULT: Self = Self {
24347 time_usec: 0_u64,
24348 press_abs: 0_i16,
24349 press_diff1: 0_i16,
24350 press_diff2: 0_i16,
24351 temperature: 0_i16,
24352 };
24353 #[cfg(feature = "arbitrary")]
24354 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24355 use arbitrary::{Arbitrary, Unstructured};
24356 let mut buf = [0u8; 1024];
24357 rng.fill_bytes(&mut buf);
24358 let mut unstructured = Unstructured::new(&buf);
24359 Self::arbitrary(&mut unstructured).unwrap_or_default()
24360 }
24361}
24362impl Default for RAW_PRESSURE_DATA {
24363 fn default() -> Self {
24364 Self::DEFAULT.clone()
24365 }
24366}
24367impl MessageData for RAW_PRESSURE_DATA {
24368 type Message = MavMessage;
24369 const ID: u32 = 28u32;
24370 const NAME: &'static str = "RAW_PRESSURE";
24371 const EXTRA_CRC: u8 = 67u8;
24372 const ENCODED_LEN: usize = 16usize;
24373 fn deser(
24374 _version: MavlinkVersion,
24375 __input: &[u8],
24376 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24377 let avail_len = __input.len();
24378 let mut payload_buf = [0; Self::ENCODED_LEN];
24379 let mut buf = if avail_len < Self::ENCODED_LEN {
24380 payload_buf[0..avail_len].copy_from_slice(__input);
24381 Bytes::new(&payload_buf)
24382 } else {
24383 Bytes::new(__input)
24384 };
24385 let mut __struct = Self::default();
24386 __struct.time_usec = buf.get_u64_le();
24387 __struct.press_abs = buf.get_i16_le();
24388 __struct.press_diff1 = buf.get_i16_le();
24389 __struct.press_diff2 = buf.get_i16_le();
24390 __struct.temperature = buf.get_i16_le();
24391 Ok(__struct)
24392 }
24393 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24394 let mut __tmp = BytesMut::new(bytes);
24395 #[allow(clippy::absurd_extreme_comparisons)]
24396 #[allow(unused_comparisons)]
24397 if __tmp.remaining() < Self::ENCODED_LEN {
24398 panic!(
24399 "buffer is too small (need {} bytes, but got {})",
24400 Self::ENCODED_LEN,
24401 __tmp.remaining(),
24402 )
24403 }
24404 __tmp.put_u64_le(self.time_usec);
24405 __tmp.put_i16_le(self.press_abs);
24406 __tmp.put_i16_le(self.press_diff1);
24407 __tmp.put_i16_le(self.press_diff2);
24408 __tmp.put_i16_le(self.temperature);
24409 if matches!(version, MavlinkVersion::V2) {
24410 let len = __tmp.len();
24411 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24412 } else {
24413 __tmp.len()
24414 }
24415 }
24416}
24417#[doc = "id: 339"]
24418#[doc = "RPM sensor data message."]
24419#[derive(Debug, Clone, PartialEq)]
24420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24422pub struct RAW_RPM_DATA {
24423 #[doc = "Indicated rate"]
24424 pub frequency: f32,
24425 #[doc = "Index of this RPM sensor (0-indexed)"]
24426 pub index: u8,
24427}
24428impl RAW_RPM_DATA {
24429 pub const ENCODED_LEN: usize = 5usize;
24430 pub const DEFAULT: Self = Self {
24431 frequency: 0.0_f32,
24432 index: 0_u8,
24433 };
24434 #[cfg(feature = "arbitrary")]
24435 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24436 use arbitrary::{Arbitrary, Unstructured};
24437 let mut buf = [0u8; 1024];
24438 rng.fill_bytes(&mut buf);
24439 let mut unstructured = Unstructured::new(&buf);
24440 Self::arbitrary(&mut unstructured).unwrap_or_default()
24441 }
24442}
24443impl Default for RAW_RPM_DATA {
24444 fn default() -> Self {
24445 Self::DEFAULT.clone()
24446 }
24447}
24448impl MessageData for RAW_RPM_DATA {
24449 type Message = MavMessage;
24450 const ID: u32 = 339u32;
24451 const NAME: &'static str = "RAW_RPM";
24452 const EXTRA_CRC: u8 = 199u8;
24453 const ENCODED_LEN: usize = 5usize;
24454 fn deser(
24455 _version: MavlinkVersion,
24456 __input: &[u8],
24457 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24458 let avail_len = __input.len();
24459 let mut payload_buf = [0; Self::ENCODED_LEN];
24460 let mut buf = if avail_len < Self::ENCODED_LEN {
24461 payload_buf[0..avail_len].copy_from_slice(__input);
24462 Bytes::new(&payload_buf)
24463 } else {
24464 Bytes::new(__input)
24465 };
24466 let mut __struct = Self::default();
24467 __struct.frequency = buf.get_f32_le();
24468 __struct.index = buf.get_u8();
24469 Ok(__struct)
24470 }
24471 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24472 let mut __tmp = BytesMut::new(bytes);
24473 #[allow(clippy::absurd_extreme_comparisons)]
24474 #[allow(unused_comparisons)]
24475 if __tmp.remaining() < Self::ENCODED_LEN {
24476 panic!(
24477 "buffer is too small (need {} bytes, but got {})",
24478 Self::ENCODED_LEN,
24479 __tmp.remaining(),
24480 )
24481 }
24482 __tmp.put_f32_le(self.frequency);
24483 __tmp.put_u8(self.index);
24484 if matches!(version, MavlinkVersion::V2) {
24485 let len = __tmp.len();
24486 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24487 } else {
24488 __tmp.len()
24489 }
24490 }
24491}
24492#[doc = "id: 65"]
24493#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24494#[derive(Debug, Clone, PartialEq)]
24495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24497pub struct RC_CHANNELS_DATA {
24498 #[doc = "Timestamp (time since system boot)."]
24499 pub time_boot_ms: u32,
24500 #[doc = "RC channel 1 value."]
24501 pub chan1_raw: u16,
24502 #[doc = "RC channel 2 value."]
24503 pub chan2_raw: u16,
24504 #[doc = "RC channel 3 value."]
24505 pub chan3_raw: u16,
24506 #[doc = "RC channel 4 value."]
24507 pub chan4_raw: u16,
24508 #[doc = "RC channel 5 value."]
24509 pub chan5_raw: u16,
24510 #[doc = "RC channel 6 value."]
24511 pub chan6_raw: u16,
24512 #[doc = "RC channel 7 value."]
24513 pub chan7_raw: u16,
24514 #[doc = "RC channel 8 value."]
24515 pub chan8_raw: u16,
24516 #[doc = "RC channel 9 value."]
24517 pub chan9_raw: u16,
24518 #[doc = "RC channel 10 value."]
24519 pub chan10_raw: u16,
24520 #[doc = "RC channel 11 value."]
24521 pub chan11_raw: u16,
24522 #[doc = "RC channel 12 value."]
24523 pub chan12_raw: u16,
24524 #[doc = "RC channel 13 value."]
24525 pub chan13_raw: u16,
24526 #[doc = "RC channel 14 value."]
24527 pub chan14_raw: u16,
24528 #[doc = "RC channel 15 value."]
24529 pub chan15_raw: u16,
24530 #[doc = "RC channel 16 value."]
24531 pub chan16_raw: u16,
24532 #[doc = "RC channel 17 value."]
24533 pub chan17_raw: u16,
24534 #[doc = "RC channel 18 value."]
24535 pub chan18_raw: u16,
24536 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24537 pub chancount: u8,
24538 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24539 pub rssi: u8,
24540}
24541impl RC_CHANNELS_DATA {
24542 pub const ENCODED_LEN: usize = 42usize;
24543 pub const DEFAULT: Self = Self {
24544 time_boot_ms: 0_u32,
24545 chan1_raw: 0_u16,
24546 chan2_raw: 0_u16,
24547 chan3_raw: 0_u16,
24548 chan4_raw: 0_u16,
24549 chan5_raw: 0_u16,
24550 chan6_raw: 0_u16,
24551 chan7_raw: 0_u16,
24552 chan8_raw: 0_u16,
24553 chan9_raw: 0_u16,
24554 chan10_raw: 0_u16,
24555 chan11_raw: 0_u16,
24556 chan12_raw: 0_u16,
24557 chan13_raw: 0_u16,
24558 chan14_raw: 0_u16,
24559 chan15_raw: 0_u16,
24560 chan16_raw: 0_u16,
24561 chan17_raw: 0_u16,
24562 chan18_raw: 0_u16,
24563 chancount: 0_u8,
24564 rssi: 0_u8,
24565 };
24566 #[cfg(feature = "arbitrary")]
24567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24568 use arbitrary::{Arbitrary, Unstructured};
24569 let mut buf = [0u8; 1024];
24570 rng.fill_bytes(&mut buf);
24571 let mut unstructured = Unstructured::new(&buf);
24572 Self::arbitrary(&mut unstructured).unwrap_or_default()
24573 }
24574}
24575impl Default for RC_CHANNELS_DATA {
24576 fn default() -> Self {
24577 Self::DEFAULT.clone()
24578 }
24579}
24580impl MessageData for RC_CHANNELS_DATA {
24581 type Message = MavMessage;
24582 const ID: u32 = 65u32;
24583 const NAME: &'static str = "RC_CHANNELS";
24584 const EXTRA_CRC: u8 = 118u8;
24585 const ENCODED_LEN: usize = 42usize;
24586 fn deser(
24587 _version: MavlinkVersion,
24588 __input: &[u8],
24589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24590 let avail_len = __input.len();
24591 let mut payload_buf = [0; Self::ENCODED_LEN];
24592 let mut buf = if avail_len < Self::ENCODED_LEN {
24593 payload_buf[0..avail_len].copy_from_slice(__input);
24594 Bytes::new(&payload_buf)
24595 } else {
24596 Bytes::new(__input)
24597 };
24598 let mut __struct = Self::default();
24599 __struct.time_boot_ms = buf.get_u32_le();
24600 __struct.chan1_raw = buf.get_u16_le();
24601 __struct.chan2_raw = buf.get_u16_le();
24602 __struct.chan3_raw = buf.get_u16_le();
24603 __struct.chan4_raw = buf.get_u16_le();
24604 __struct.chan5_raw = buf.get_u16_le();
24605 __struct.chan6_raw = buf.get_u16_le();
24606 __struct.chan7_raw = buf.get_u16_le();
24607 __struct.chan8_raw = buf.get_u16_le();
24608 __struct.chan9_raw = buf.get_u16_le();
24609 __struct.chan10_raw = buf.get_u16_le();
24610 __struct.chan11_raw = buf.get_u16_le();
24611 __struct.chan12_raw = buf.get_u16_le();
24612 __struct.chan13_raw = buf.get_u16_le();
24613 __struct.chan14_raw = buf.get_u16_le();
24614 __struct.chan15_raw = buf.get_u16_le();
24615 __struct.chan16_raw = buf.get_u16_le();
24616 __struct.chan17_raw = buf.get_u16_le();
24617 __struct.chan18_raw = buf.get_u16_le();
24618 __struct.chancount = buf.get_u8();
24619 __struct.rssi = buf.get_u8();
24620 Ok(__struct)
24621 }
24622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24623 let mut __tmp = BytesMut::new(bytes);
24624 #[allow(clippy::absurd_extreme_comparisons)]
24625 #[allow(unused_comparisons)]
24626 if __tmp.remaining() < Self::ENCODED_LEN {
24627 panic!(
24628 "buffer is too small (need {} bytes, but got {})",
24629 Self::ENCODED_LEN,
24630 __tmp.remaining(),
24631 )
24632 }
24633 __tmp.put_u32_le(self.time_boot_ms);
24634 __tmp.put_u16_le(self.chan1_raw);
24635 __tmp.put_u16_le(self.chan2_raw);
24636 __tmp.put_u16_le(self.chan3_raw);
24637 __tmp.put_u16_le(self.chan4_raw);
24638 __tmp.put_u16_le(self.chan5_raw);
24639 __tmp.put_u16_le(self.chan6_raw);
24640 __tmp.put_u16_le(self.chan7_raw);
24641 __tmp.put_u16_le(self.chan8_raw);
24642 __tmp.put_u16_le(self.chan9_raw);
24643 __tmp.put_u16_le(self.chan10_raw);
24644 __tmp.put_u16_le(self.chan11_raw);
24645 __tmp.put_u16_le(self.chan12_raw);
24646 __tmp.put_u16_le(self.chan13_raw);
24647 __tmp.put_u16_le(self.chan14_raw);
24648 __tmp.put_u16_le(self.chan15_raw);
24649 __tmp.put_u16_le(self.chan16_raw);
24650 __tmp.put_u16_le(self.chan17_raw);
24651 __tmp.put_u16_le(self.chan18_raw);
24652 __tmp.put_u8(self.chancount);
24653 __tmp.put_u8(self.rssi);
24654 if matches!(version, MavlinkVersion::V2) {
24655 let len = __tmp.len();
24656 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24657 } else {
24658 __tmp.len()
24659 }
24660 }
24661}
24662#[doc = "id: 70"]
24663#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
24664#[derive(Debug, Clone, PartialEq)]
24665#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24666#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24667pub struct RC_CHANNELS_OVERRIDE_DATA {
24668 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24669 pub chan1_raw: u16,
24670 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24671 pub chan2_raw: u16,
24672 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24673 pub chan3_raw: u16,
24674 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24675 pub chan4_raw: u16,
24676 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24677 pub chan5_raw: u16,
24678 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24679 pub chan6_raw: u16,
24680 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24681 pub chan7_raw: u16,
24682 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
24683 pub chan8_raw: u16,
24684 #[doc = "System ID"]
24685 pub target_system: u8,
24686 #[doc = "Component ID"]
24687 pub target_component: u8,
24688 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24689 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24690 pub chan9_raw: u16,
24691 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24692 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24693 pub chan10_raw: u16,
24694 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24695 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24696 pub chan11_raw: u16,
24697 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24698 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24699 pub chan12_raw: u16,
24700 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24701 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24702 pub chan13_raw: u16,
24703 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24704 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24705 pub chan14_raw: u16,
24706 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24708 pub chan15_raw: u16,
24709 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24711 pub chan16_raw: u16,
24712 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24713 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24714 pub chan17_raw: u16,
24715 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
24716 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24717 pub chan18_raw: u16,
24718}
24719impl RC_CHANNELS_OVERRIDE_DATA {
24720 pub const ENCODED_LEN: usize = 38usize;
24721 pub const DEFAULT: Self = Self {
24722 chan1_raw: 0_u16,
24723 chan2_raw: 0_u16,
24724 chan3_raw: 0_u16,
24725 chan4_raw: 0_u16,
24726 chan5_raw: 0_u16,
24727 chan6_raw: 0_u16,
24728 chan7_raw: 0_u16,
24729 chan8_raw: 0_u16,
24730 target_system: 0_u8,
24731 target_component: 0_u8,
24732 chan9_raw: 0_u16,
24733 chan10_raw: 0_u16,
24734 chan11_raw: 0_u16,
24735 chan12_raw: 0_u16,
24736 chan13_raw: 0_u16,
24737 chan14_raw: 0_u16,
24738 chan15_raw: 0_u16,
24739 chan16_raw: 0_u16,
24740 chan17_raw: 0_u16,
24741 chan18_raw: 0_u16,
24742 };
24743 #[cfg(feature = "arbitrary")]
24744 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24745 use arbitrary::{Arbitrary, Unstructured};
24746 let mut buf = [0u8; 1024];
24747 rng.fill_bytes(&mut buf);
24748 let mut unstructured = Unstructured::new(&buf);
24749 Self::arbitrary(&mut unstructured).unwrap_or_default()
24750 }
24751}
24752impl Default for RC_CHANNELS_OVERRIDE_DATA {
24753 fn default() -> Self {
24754 Self::DEFAULT.clone()
24755 }
24756}
24757impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
24758 type Message = MavMessage;
24759 const ID: u32 = 70u32;
24760 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
24761 const EXTRA_CRC: u8 = 124u8;
24762 const ENCODED_LEN: usize = 38usize;
24763 fn deser(
24764 _version: MavlinkVersion,
24765 __input: &[u8],
24766 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24767 let avail_len = __input.len();
24768 let mut payload_buf = [0; Self::ENCODED_LEN];
24769 let mut buf = if avail_len < Self::ENCODED_LEN {
24770 payload_buf[0..avail_len].copy_from_slice(__input);
24771 Bytes::new(&payload_buf)
24772 } else {
24773 Bytes::new(__input)
24774 };
24775 let mut __struct = Self::default();
24776 __struct.chan1_raw = buf.get_u16_le();
24777 __struct.chan2_raw = buf.get_u16_le();
24778 __struct.chan3_raw = buf.get_u16_le();
24779 __struct.chan4_raw = buf.get_u16_le();
24780 __struct.chan5_raw = buf.get_u16_le();
24781 __struct.chan6_raw = buf.get_u16_le();
24782 __struct.chan7_raw = buf.get_u16_le();
24783 __struct.chan8_raw = buf.get_u16_le();
24784 __struct.target_system = buf.get_u8();
24785 __struct.target_component = buf.get_u8();
24786 __struct.chan9_raw = buf.get_u16_le();
24787 __struct.chan10_raw = buf.get_u16_le();
24788 __struct.chan11_raw = buf.get_u16_le();
24789 __struct.chan12_raw = buf.get_u16_le();
24790 __struct.chan13_raw = buf.get_u16_le();
24791 __struct.chan14_raw = buf.get_u16_le();
24792 __struct.chan15_raw = buf.get_u16_le();
24793 __struct.chan16_raw = buf.get_u16_le();
24794 __struct.chan17_raw = buf.get_u16_le();
24795 __struct.chan18_raw = buf.get_u16_le();
24796 Ok(__struct)
24797 }
24798 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24799 let mut __tmp = BytesMut::new(bytes);
24800 #[allow(clippy::absurd_extreme_comparisons)]
24801 #[allow(unused_comparisons)]
24802 if __tmp.remaining() < Self::ENCODED_LEN {
24803 panic!(
24804 "buffer is too small (need {} bytes, but got {})",
24805 Self::ENCODED_LEN,
24806 __tmp.remaining(),
24807 )
24808 }
24809 __tmp.put_u16_le(self.chan1_raw);
24810 __tmp.put_u16_le(self.chan2_raw);
24811 __tmp.put_u16_le(self.chan3_raw);
24812 __tmp.put_u16_le(self.chan4_raw);
24813 __tmp.put_u16_le(self.chan5_raw);
24814 __tmp.put_u16_le(self.chan6_raw);
24815 __tmp.put_u16_le(self.chan7_raw);
24816 __tmp.put_u16_le(self.chan8_raw);
24817 __tmp.put_u8(self.target_system);
24818 __tmp.put_u8(self.target_component);
24819 __tmp.put_u16_le(self.chan9_raw);
24820 __tmp.put_u16_le(self.chan10_raw);
24821 __tmp.put_u16_le(self.chan11_raw);
24822 __tmp.put_u16_le(self.chan12_raw);
24823 __tmp.put_u16_le(self.chan13_raw);
24824 __tmp.put_u16_le(self.chan14_raw);
24825 __tmp.put_u16_le(self.chan15_raw);
24826 __tmp.put_u16_le(self.chan16_raw);
24827 __tmp.put_u16_le(self.chan17_raw);
24828 __tmp.put_u16_le(self.chan18_raw);
24829 if matches!(version, MavlinkVersion::V2) {
24830 let len = __tmp.len();
24831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24832 } else {
24833 __tmp.len()
24834 }
24835 }
24836}
24837#[doc = "id: 35"]
24838#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24839#[derive(Debug, Clone, PartialEq)]
24840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24842pub struct RC_CHANNELS_RAW_DATA {
24843 #[doc = "Timestamp (time since system boot)."]
24844 pub time_boot_ms: u32,
24845 #[doc = "RC channel 1 value."]
24846 pub chan1_raw: u16,
24847 #[doc = "RC channel 2 value."]
24848 pub chan2_raw: u16,
24849 #[doc = "RC channel 3 value."]
24850 pub chan3_raw: u16,
24851 #[doc = "RC channel 4 value."]
24852 pub chan4_raw: u16,
24853 #[doc = "RC channel 5 value."]
24854 pub chan5_raw: u16,
24855 #[doc = "RC channel 6 value."]
24856 pub chan6_raw: u16,
24857 #[doc = "RC channel 7 value."]
24858 pub chan7_raw: u16,
24859 #[doc = "RC channel 8 value."]
24860 pub chan8_raw: u16,
24861 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24862 pub port: u8,
24863 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24864 pub rssi: u8,
24865}
24866impl RC_CHANNELS_RAW_DATA {
24867 pub const ENCODED_LEN: usize = 22usize;
24868 pub const DEFAULT: Self = Self {
24869 time_boot_ms: 0_u32,
24870 chan1_raw: 0_u16,
24871 chan2_raw: 0_u16,
24872 chan3_raw: 0_u16,
24873 chan4_raw: 0_u16,
24874 chan5_raw: 0_u16,
24875 chan6_raw: 0_u16,
24876 chan7_raw: 0_u16,
24877 chan8_raw: 0_u16,
24878 port: 0_u8,
24879 rssi: 0_u8,
24880 };
24881 #[cfg(feature = "arbitrary")]
24882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24883 use arbitrary::{Arbitrary, Unstructured};
24884 let mut buf = [0u8; 1024];
24885 rng.fill_bytes(&mut buf);
24886 let mut unstructured = Unstructured::new(&buf);
24887 Self::arbitrary(&mut unstructured).unwrap_or_default()
24888 }
24889}
24890impl Default for RC_CHANNELS_RAW_DATA {
24891 fn default() -> Self {
24892 Self::DEFAULT.clone()
24893 }
24894}
24895impl MessageData for RC_CHANNELS_RAW_DATA {
24896 type Message = MavMessage;
24897 const ID: u32 = 35u32;
24898 const NAME: &'static str = "RC_CHANNELS_RAW";
24899 const EXTRA_CRC: u8 = 244u8;
24900 const ENCODED_LEN: usize = 22usize;
24901 fn deser(
24902 _version: MavlinkVersion,
24903 __input: &[u8],
24904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24905 let avail_len = __input.len();
24906 let mut payload_buf = [0; Self::ENCODED_LEN];
24907 let mut buf = if avail_len < Self::ENCODED_LEN {
24908 payload_buf[0..avail_len].copy_from_slice(__input);
24909 Bytes::new(&payload_buf)
24910 } else {
24911 Bytes::new(__input)
24912 };
24913 let mut __struct = Self::default();
24914 __struct.time_boot_ms = buf.get_u32_le();
24915 __struct.chan1_raw = buf.get_u16_le();
24916 __struct.chan2_raw = buf.get_u16_le();
24917 __struct.chan3_raw = buf.get_u16_le();
24918 __struct.chan4_raw = buf.get_u16_le();
24919 __struct.chan5_raw = buf.get_u16_le();
24920 __struct.chan6_raw = buf.get_u16_le();
24921 __struct.chan7_raw = buf.get_u16_le();
24922 __struct.chan8_raw = buf.get_u16_le();
24923 __struct.port = buf.get_u8();
24924 __struct.rssi = buf.get_u8();
24925 Ok(__struct)
24926 }
24927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24928 let mut __tmp = BytesMut::new(bytes);
24929 #[allow(clippy::absurd_extreme_comparisons)]
24930 #[allow(unused_comparisons)]
24931 if __tmp.remaining() < Self::ENCODED_LEN {
24932 panic!(
24933 "buffer is too small (need {} bytes, but got {})",
24934 Self::ENCODED_LEN,
24935 __tmp.remaining(),
24936 )
24937 }
24938 __tmp.put_u32_le(self.time_boot_ms);
24939 __tmp.put_u16_le(self.chan1_raw);
24940 __tmp.put_u16_le(self.chan2_raw);
24941 __tmp.put_u16_le(self.chan3_raw);
24942 __tmp.put_u16_le(self.chan4_raw);
24943 __tmp.put_u16_le(self.chan5_raw);
24944 __tmp.put_u16_le(self.chan6_raw);
24945 __tmp.put_u16_le(self.chan7_raw);
24946 __tmp.put_u16_le(self.chan8_raw);
24947 __tmp.put_u8(self.port);
24948 __tmp.put_u8(self.rssi);
24949 if matches!(version, MavlinkVersion::V2) {
24950 let len = __tmp.len();
24951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24952 } else {
24953 __tmp.len()
24954 }
24955 }
24956}
24957#[doc = "id: 34"]
24958#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
24959#[derive(Debug, Clone, PartialEq)]
24960#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24962pub struct RC_CHANNELS_SCALED_DATA {
24963 #[doc = "Timestamp (time since system boot)."]
24964 pub time_boot_ms: u32,
24965 #[doc = "RC channel 1 value scaled."]
24966 pub chan1_scaled: i16,
24967 #[doc = "RC channel 2 value scaled."]
24968 pub chan2_scaled: i16,
24969 #[doc = "RC channel 3 value scaled."]
24970 pub chan3_scaled: i16,
24971 #[doc = "RC channel 4 value scaled."]
24972 pub chan4_scaled: i16,
24973 #[doc = "RC channel 5 value scaled."]
24974 pub chan5_scaled: i16,
24975 #[doc = "RC channel 6 value scaled."]
24976 pub chan6_scaled: i16,
24977 #[doc = "RC channel 7 value scaled."]
24978 pub chan7_scaled: i16,
24979 #[doc = "RC channel 8 value scaled."]
24980 pub chan8_scaled: i16,
24981 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
24982 pub port: u8,
24983 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24984 pub rssi: u8,
24985}
24986impl RC_CHANNELS_SCALED_DATA {
24987 pub const ENCODED_LEN: usize = 22usize;
24988 pub const DEFAULT: Self = Self {
24989 time_boot_ms: 0_u32,
24990 chan1_scaled: 0_i16,
24991 chan2_scaled: 0_i16,
24992 chan3_scaled: 0_i16,
24993 chan4_scaled: 0_i16,
24994 chan5_scaled: 0_i16,
24995 chan6_scaled: 0_i16,
24996 chan7_scaled: 0_i16,
24997 chan8_scaled: 0_i16,
24998 port: 0_u8,
24999 rssi: 0_u8,
25000 };
25001 #[cfg(feature = "arbitrary")]
25002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25003 use arbitrary::{Arbitrary, Unstructured};
25004 let mut buf = [0u8; 1024];
25005 rng.fill_bytes(&mut buf);
25006 let mut unstructured = Unstructured::new(&buf);
25007 Self::arbitrary(&mut unstructured).unwrap_or_default()
25008 }
25009}
25010impl Default for RC_CHANNELS_SCALED_DATA {
25011 fn default() -> Self {
25012 Self::DEFAULT.clone()
25013 }
25014}
25015impl MessageData for RC_CHANNELS_SCALED_DATA {
25016 type Message = MavMessage;
25017 const ID: u32 = 34u32;
25018 const NAME: &'static str = "RC_CHANNELS_SCALED";
25019 const EXTRA_CRC: u8 = 237u8;
25020 const ENCODED_LEN: usize = 22usize;
25021 fn deser(
25022 _version: MavlinkVersion,
25023 __input: &[u8],
25024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25025 let avail_len = __input.len();
25026 let mut payload_buf = [0; Self::ENCODED_LEN];
25027 let mut buf = if avail_len < Self::ENCODED_LEN {
25028 payload_buf[0..avail_len].copy_from_slice(__input);
25029 Bytes::new(&payload_buf)
25030 } else {
25031 Bytes::new(__input)
25032 };
25033 let mut __struct = Self::default();
25034 __struct.time_boot_ms = buf.get_u32_le();
25035 __struct.chan1_scaled = buf.get_i16_le();
25036 __struct.chan2_scaled = buf.get_i16_le();
25037 __struct.chan3_scaled = buf.get_i16_le();
25038 __struct.chan4_scaled = buf.get_i16_le();
25039 __struct.chan5_scaled = buf.get_i16_le();
25040 __struct.chan6_scaled = buf.get_i16_le();
25041 __struct.chan7_scaled = buf.get_i16_le();
25042 __struct.chan8_scaled = buf.get_i16_le();
25043 __struct.port = buf.get_u8();
25044 __struct.rssi = buf.get_u8();
25045 Ok(__struct)
25046 }
25047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25048 let mut __tmp = BytesMut::new(bytes);
25049 #[allow(clippy::absurd_extreme_comparisons)]
25050 #[allow(unused_comparisons)]
25051 if __tmp.remaining() < Self::ENCODED_LEN {
25052 panic!(
25053 "buffer is too small (need {} bytes, but got {})",
25054 Self::ENCODED_LEN,
25055 __tmp.remaining(),
25056 )
25057 }
25058 __tmp.put_u32_le(self.time_boot_ms);
25059 __tmp.put_i16_le(self.chan1_scaled);
25060 __tmp.put_i16_le(self.chan2_scaled);
25061 __tmp.put_i16_le(self.chan3_scaled);
25062 __tmp.put_i16_le(self.chan4_scaled);
25063 __tmp.put_i16_le(self.chan5_scaled);
25064 __tmp.put_i16_le(self.chan6_scaled);
25065 __tmp.put_i16_le(self.chan7_scaled);
25066 __tmp.put_i16_le(self.chan8_scaled);
25067 __tmp.put_u8(self.port);
25068 __tmp.put_u8(self.rssi);
25069 if matches!(version, MavlinkVersion::V2) {
25070 let len = __tmp.len();
25071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25072 } else {
25073 __tmp.len()
25074 }
25075 }
25076}
25077#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25078#[doc = "id: 66"]
25079#[doc = "Request a data stream."]
25080#[derive(Debug, Clone, PartialEq)]
25081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25083pub struct REQUEST_DATA_STREAM_DATA {
25084 #[doc = "The requested message rate"]
25085 pub req_message_rate: u16,
25086 #[doc = "The target requested to send the message stream."]
25087 pub target_system: u8,
25088 #[doc = "The target requested to send the message stream."]
25089 pub target_component: u8,
25090 #[doc = "The ID of the requested data stream"]
25091 pub req_stream_id: u8,
25092 #[doc = "1 to start sending, 0 to stop sending."]
25093 pub start_stop: u8,
25094}
25095impl REQUEST_DATA_STREAM_DATA {
25096 pub const ENCODED_LEN: usize = 6usize;
25097 pub const DEFAULT: Self = Self {
25098 req_message_rate: 0_u16,
25099 target_system: 0_u8,
25100 target_component: 0_u8,
25101 req_stream_id: 0_u8,
25102 start_stop: 0_u8,
25103 };
25104 #[cfg(feature = "arbitrary")]
25105 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25106 use arbitrary::{Arbitrary, Unstructured};
25107 let mut buf = [0u8; 1024];
25108 rng.fill_bytes(&mut buf);
25109 let mut unstructured = Unstructured::new(&buf);
25110 Self::arbitrary(&mut unstructured).unwrap_or_default()
25111 }
25112}
25113impl Default for REQUEST_DATA_STREAM_DATA {
25114 fn default() -> Self {
25115 Self::DEFAULT.clone()
25116 }
25117}
25118impl MessageData for REQUEST_DATA_STREAM_DATA {
25119 type Message = MavMessage;
25120 const ID: u32 = 66u32;
25121 const NAME: &'static str = "REQUEST_DATA_STREAM";
25122 const EXTRA_CRC: u8 = 148u8;
25123 const ENCODED_LEN: usize = 6usize;
25124 fn deser(
25125 _version: MavlinkVersion,
25126 __input: &[u8],
25127 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25128 let avail_len = __input.len();
25129 let mut payload_buf = [0; Self::ENCODED_LEN];
25130 let mut buf = if avail_len < Self::ENCODED_LEN {
25131 payload_buf[0..avail_len].copy_from_slice(__input);
25132 Bytes::new(&payload_buf)
25133 } else {
25134 Bytes::new(__input)
25135 };
25136 let mut __struct = Self::default();
25137 __struct.req_message_rate = buf.get_u16_le();
25138 __struct.target_system = buf.get_u8();
25139 __struct.target_component = buf.get_u8();
25140 __struct.req_stream_id = buf.get_u8();
25141 __struct.start_stop = buf.get_u8();
25142 Ok(__struct)
25143 }
25144 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25145 let mut __tmp = BytesMut::new(bytes);
25146 #[allow(clippy::absurd_extreme_comparisons)]
25147 #[allow(unused_comparisons)]
25148 if __tmp.remaining() < Self::ENCODED_LEN {
25149 panic!(
25150 "buffer is too small (need {} bytes, but got {})",
25151 Self::ENCODED_LEN,
25152 __tmp.remaining(),
25153 )
25154 }
25155 __tmp.put_u16_le(self.req_message_rate);
25156 __tmp.put_u8(self.target_system);
25157 __tmp.put_u8(self.target_component);
25158 __tmp.put_u8(self.req_stream_id);
25159 __tmp.put_u8(self.start_stop);
25160 if matches!(version, MavlinkVersion::V2) {
25161 let len = __tmp.len();
25162 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25163 } else {
25164 __tmp.len()
25165 }
25166 }
25167}
25168#[doc = "id: 412"]
25169#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25170#[derive(Debug, Clone, PartialEq)]
25171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25173pub struct REQUEST_EVENT_DATA {
25174 #[doc = "First sequence number of the requested event."]
25175 pub first_sequence: u16,
25176 #[doc = "Last sequence number of the requested event."]
25177 pub last_sequence: u16,
25178 #[doc = "System ID"]
25179 pub target_system: u8,
25180 #[doc = "Component ID"]
25181 pub target_component: u8,
25182}
25183impl REQUEST_EVENT_DATA {
25184 pub const ENCODED_LEN: usize = 6usize;
25185 pub const DEFAULT: Self = Self {
25186 first_sequence: 0_u16,
25187 last_sequence: 0_u16,
25188 target_system: 0_u8,
25189 target_component: 0_u8,
25190 };
25191 #[cfg(feature = "arbitrary")]
25192 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25193 use arbitrary::{Arbitrary, Unstructured};
25194 let mut buf = [0u8; 1024];
25195 rng.fill_bytes(&mut buf);
25196 let mut unstructured = Unstructured::new(&buf);
25197 Self::arbitrary(&mut unstructured).unwrap_or_default()
25198 }
25199}
25200impl Default for REQUEST_EVENT_DATA {
25201 fn default() -> Self {
25202 Self::DEFAULT.clone()
25203 }
25204}
25205impl MessageData for REQUEST_EVENT_DATA {
25206 type Message = MavMessage;
25207 const ID: u32 = 412u32;
25208 const NAME: &'static str = "REQUEST_EVENT";
25209 const EXTRA_CRC: u8 = 33u8;
25210 const ENCODED_LEN: usize = 6usize;
25211 fn deser(
25212 _version: MavlinkVersion,
25213 __input: &[u8],
25214 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25215 let avail_len = __input.len();
25216 let mut payload_buf = [0; Self::ENCODED_LEN];
25217 let mut buf = if avail_len < Self::ENCODED_LEN {
25218 payload_buf[0..avail_len].copy_from_slice(__input);
25219 Bytes::new(&payload_buf)
25220 } else {
25221 Bytes::new(__input)
25222 };
25223 let mut __struct = Self::default();
25224 __struct.first_sequence = buf.get_u16_le();
25225 __struct.last_sequence = buf.get_u16_le();
25226 __struct.target_system = buf.get_u8();
25227 __struct.target_component = buf.get_u8();
25228 Ok(__struct)
25229 }
25230 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25231 let mut __tmp = BytesMut::new(bytes);
25232 #[allow(clippy::absurd_extreme_comparisons)]
25233 #[allow(unused_comparisons)]
25234 if __tmp.remaining() < Self::ENCODED_LEN {
25235 panic!(
25236 "buffer is too small (need {} bytes, but got {})",
25237 Self::ENCODED_LEN,
25238 __tmp.remaining(),
25239 )
25240 }
25241 __tmp.put_u16_le(self.first_sequence);
25242 __tmp.put_u16_le(self.last_sequence);
25243 __tmp.put_u8(self.target_system);
25244 __tmp.put_u8(self.target_component);
25245 if matches!(version, MavlinkVersion::V2) {
25246 let len = __tmp.len();
25247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25248 } else {
25249 __tmp.len()
25250 }
25251 }
25252}
25253#[doc = "id: 142"]
25254#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25255#[derive(Debug, Clone, PartialEq)]
25256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25258pub struct RESOURCE_REQUEST_DATA {
25259 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25260 pub request_id: u8,
25261 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25262 pub uri_type: u8,
25263 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25264 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25265 pub uri: [u8; 120],
25266 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25267 pub transfer_type: u8,
25268 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25269 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25270 pub storage: [u8; 120],
25271}
25272impl RESOURCE_REQUEST_DATA {
25273 pub const ENCODED_LEN: usize = 243usize;
25274 pub const DEFAULT: Self = Self {
25275 request_id: 0_u8,
25276 uri_type: 0_u8,
25277 uri: [0_u8; 120usize],
25278 transfer_type: 0_u8,
25279 storage: [0_u8; 120usize],
25280 };
25281 #[cfg(feature = "arbitrary")]
25282 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25283 use arbitrary::{Arbitrary, Unstructured};
25284 let mut buf = [0u8; 1024];
25285 rng.fill_bytes(&mut buf);
25286 let mut unstructured = Unstructured::new(&buf);
25287 Self::arbitrary(&mut unstructured).unwrap_or_default()
25288 }
25289}
25290impl Default for RESOURCE_REQUEST_DATA {
25291 fn default() -> Self {
25292 Self::DEFAULT.clone()
25293 }
25294}
25295impl MessageData for RESOURCE_REQUEST_DATA {
25296 type Message = MavMessage;
25297 const ID: u32 = 142u32;
25298 const NAME: &'static str = "RESOURCE_REQUEST";
25299 const EXTRA_CRC: u8 = 72u8;
25300 const ENCODED_LEN: usize = 243usize;
25301 fn deser(
25302 _version: MavlinkVersion,
25303 __input: &[u8],
25304 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25305 let avail_len = __input.len();
25306 let mut payload_buf = [0; Self::ENCODED_LEN];
25307 let mut buf = if avail_len < Self::ENCODED_LEN {
25308 payload_buf[0..avail_len].copy_from_slice(__input);
25309 Bytes::new(&payload_buf)
25310 } else {
25311 Bytes::new(__input)
25312 };
25313 let mut __struct = Self::default();
25314 __struct.request_id = buf.get_u8();
25315 __struct.uri_type = buf.get_u8();
25316 for v in &mut __struct.uri {
25317 let val = buf.get_u8();
25318 *v = val;
25319 }
25320 __struct.transfer_type = buf.get_u8();
25321 for v in &mut __struct.storage {
25322 let val = buf.get_u8();
25323 *v = val;
25324 }
25325 Ok(__struct)
25326 }
25327 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25328 let mut __tmp = BytesMut::new(bytes);
25329 #[allow(clippy::absurd_extreme_comparisons)]
25330 #[allow(unused_comparisons)]
25331 if __tmp.remaining() < Self::ENCODED_LEN {
25332 panic!(
25333 "buffer is too small (need {} bytes, but got {})",
25334 Self::ENCODED_LEN,
25335 __tmp.remaining(),
25336 )
25337 }
25338 __tmp.put_u8(self.request_id);
25339 __tmp.put_u8(self.uri_type);
25340 for val in &self.uri {
25341 __tmp.put_u8(*val);
25342 }
25343 __tmp.put_u8(self.transfer_type);
25344 for val in &self.storage {
25345 __tmp.put_u8(*val);
25346 }
25347 if matches!(version, MavlinkVersion::V2) {
25348 let len = __tmp.len();
25349 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25350 } else {
25351 __tmp.len()
25352 }
25353 }
25354}
25355#[doc = "id: 413"]
25356#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25357#[derive(Debug, Clone, PartialEq)]
25358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25360pub struct RESPONSE_EVENT_ERROR_DATA {
25361 #[doc = "Sequence number."]
25362 pub sequence: u16,
25363 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25364 pub sequence_oldest_available: u16,
25365 #[doc = "System ID"]
25366 pub target_system: u8,
25367 #[doc = "Component ID"]
25368 pub target_component: u8,
25369 #[doc = "Error reason."]
25370 pub reason: MavEventErrorReason,
25371}
25372impl RESPONSE_EVENT_ERROR_DATA {
25373 pub const ENCODED_LEN: usize = 7usize;
25374 pub const DEFAULT: Self = Self {
25375 sequence: 0_u16,
25376 sequence_oldest_available: 0_u16,
25377 target_system: 0_u8,
25378 target_component: 0_u8,
25379 reason: MavEventErrorReason::DEFAULT,
25380 };
25381 #[cfg(feature = "arbitrary")]
25382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25383 use arbitrary::{Arbitrary, Unstructured};
25384 let mut buf = [0u8; 1024];
25385 rng.fill_bytes(&mut buf);
25386 let mut unstructured = Unstructured::new(&buf);
25387 Self::arbitrary(&mut unstructured).unwrap_or_default()
25388 }
25389}
25390impl Default for RESPONSE_EVENT_ERROR_DATA {
25391 fn default() -> Self {
25392 Self::DEFAULT.clone()
25393 }
25394}
25395impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25396 type Message = MavMessage;
25397 const ID: u32 = 413u32;
25398 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25399 const EXTRA_CRC: u8 = 77u8;
25400 const ENCODED_LEN: usize = 7usize;
25401 fn deser(
25402 _version: MavlinkVersion,
25403 __input: &[u8],
25404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25405 let avail_len = __input.len();
25406 let mut payload_buf = [0; Self::ENCODED_LEN];
25407 let mut buf = if avail_len < Self::ENCODED_LEN {
25408 payload_buf[0..avail_len].copy_from_slice(__input);
25409 Bytes::new(&payload_buf)
25410 } else {
25411 Bytes::new(__input)
25412 };
25413 let mut __struct = Self::default();
25414 __struct.sequence = buf.get_u16_le();
25415 __struct.sequence_oldest_available = buf.get_u16_le();
25416 __struct.target_system = buf.get_u8();
25417 __struct.target_component = buf.get_u8();
25418 let tmp = buf.get_u8();
25419 __struct.reason =
25420 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25421 enum_type: "MavEventErrorReason",
25422 value: tmp as u32,
25423 })?;
25424 Ok(__struct)
25425 }
25426 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25427 let mut __tmp = BytesMut::new(bytes);
25428 #[allow(clippy::absurd_extreme_comparisons)]
25429 #[allow(unused_comparisons)]
25430 if __tmp.remaining() < Self::ENCODED_LEN {
25431 panic!(
25432 "buffer is too small (need {} bytes, but got {})",
25433 Self::ENCODED_LEN,
25434 __tmp.remaining(),
25435 )
25436 }
25437 __tmp.put_u16_le(self.sequence);
25438 __tmp.put_u16_le(self.sequence_oldest_available);
25439 __tmp.put_u8(self.target_system);
25440 __tmp.put_u8(self.target_component);
25441 __tmp.put_u8(self.reason as u8);
25442 if matches!(version, MavlinkVersion::V2) {
25443 let len = __tmp.len();
25444 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25445 } else {
25446 __tmp.len()
25447 }
25448 }
25449}
25450#[doc = "id: 55"]
25451#[doc = "Read out the safety zone the MAV currently assumes."]
25452#[derive(Debug, Clone, PartialEq)]
25453#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25455pub struct SAFETY_ALLOWED_AREA_DATA {
25456 #[doc = "x position 1 / Latitude 1"]
25457 pub p1x: f32,
25458 #[doc = "y position 1 / Longitude 1"]
25459 pub p1y: f32,
25460 #[doc = "z position 1 / Altitude 1"]
25461 pub p1z: f32,
25462 #[doc = "x position 2 / Latitude 2"]
25463 pub p2x: f32,
25464 #[doc = "y position 2 / Longitude 2"]
25465 pub p2y: f32,
25466 #[doc = "z position 2 / Altitude 2"]
25467 pub p2z: f32,
25468 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25469 pub frame: MavFrame,
25470}
25471impl SAFETY_ALLOWED_AREA_DATA {
25472 pub const ENCODED_LEN: usize = 25usize;
25473 pub const DEFAULT: Self = Self {
25474 p1x: 0.0_f32,
25475 p1y: 0.0_f32,
25476 p1z: 0.0_f32,
25477 p2x: 0.0_f32,
25478 p2y: 0.0_f32,
25479 p2z: 0.0_f32,
25480 frame: MavFrame::DEFAULT,
25481 };
25482 #[cfg(feature = "arbitrary")]
25483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25484 use arbitrary::{Arbitrary, Unstructured};
25485 let mut buf = [0u8; 1024];
25486 rng.fill_bytes(&mut buf);
25487 let mut unstructured = Unstructured::new(&buf);
25488 Self::arbitrary(&mut unstructured).unwrap_or_default()
25489 }
25490}
25491impl Default for SAFETY_ALLOWED_AREA_DATA {
25492 fn default() -> Self {
25493 Self::DEFAULT.clone()
25494 }
25495}
25496impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25497 type Message = MavMessage;
25498 const ID: u32 = 55u32;
25499 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25500 const EXTRA_CRC: u8 = 3u8;
25501 const ENCODED_LEN: usize = 25usize;
25502 fn deser(
25503 _version: MavlinkVersion,
25504 __input: &[u8],
25505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25506 let avail_len = __input.len();
25507 let mut payload_buf = [0; Self::ENCODED_LEN];
25508 let mut buf = if avail_len < Self::ENCODED_LEN {
25509 payload_buf[0..avail_len].copy_from_slice(__input);
25510 Bytes::new(&payload_buf)
25511 } else {
25512 Bytes::new(__input)
25513 };
25514 let mut __struct = Self::default();
25515 __struct.p1x = buf.get_f32_le();
25516 __struct.p1y = buf.get_f32_le();
25517 __struct.p1z = buf.get_f32_le();
25518 __struct.p2x = buf.get_f32_le();
25519 __struct.p2y = buf.get_f32_le();
25520 __struct.p2z = buf.get_f32_le();
25521 let tmp = buf.get_u8();
25522 __struct.frame =
25523 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25524 enum_type: "MavFrame",
25525 value: tmp as u32,
25526 })?;
25527 Ok(__struct)
25528 }
25529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25530 let mut __tmp = BytesMut::new(bytes);
25531 #[allow(clippy::absurd_extreme_comparisons)]
25532 #[allow(unused_comparisons)]
25533 if __tmp.remaining() < Self::ENCODED_LEN {
25534 panic!(
25535 "buffer is too small (need {} bytes, but got {})",
25536 Self::ENCODED_LEN,
25537 __tmp.remaining(),
25538 )
25539 }
25540 __tmp.put_f32_le(self.p1x);
25541 __tmp.put_f32_le(self.p1y);
25542 __tmp.put_f32_le(self.p1z);
25543 __tmp.put_f32_le(self.p2x);
25544 __tmp.put_f32_le(self.p2y);
25545 __tmp.put_f32_le(self.p2z);
25546 __tmp.put_u8(self.frame as u8);
25547 if matches!(version, MavlinkVersion::V2) {
25548 let len = __tmp.len();
25549 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25550 } else {
25551 __tmp.len()
25552 }
25553 }
25554}
25555#[doc = "id: 54"]
25556#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
25557#[derive(Debug, Clone, PartialEq)]
25558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25559#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25560pub struct SAFETY_SET_ALLOWED_AREA_DATA {
25561 #[doc = "x position 1 / Latitude 1"]
25562 pub p1x: f32,
25563 #[doc = "y position 1 / Longitude 1"]
25564 pub p1y: f32,
25565 #[doc = "z position 1 / Altitude 1"]
25566 pub p1z: f32,
25567 #[doc = "x position 2 / Latitude 2"]
25568 pub p2x: f32,
25569 #[doc = "y position 2 / Longitude 2"]
25570 pub p2y: f32,
25571 #[doc = "z position 2 / Altitude 2"]
25572 pub p2z: f32,
25573 #[doc = "System ID"]
25574 pub target_system: u8,
25575 #[doc = "Component ID"]
25576 pub target_component: u8,
25577 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25578 pub frame: MavFrame,
25579}
25580impl SAFETY_SET_ALLOWED_AREA_DATA {
25581 pub const ENCODED_LEN: usize = 27usize;
25582 pub const DEFAULT: Self = Self {
25583 p1x: 0.0_f32,
25584 p1y: 0.0_f32,
25585 p1z: 0.0_f32,
25586 p2x: 0.0_f32,
25587 p2y: 0.0_f32,
25588 p2z: 0.0_f32,
25589 target_system: 0_u8,
25590 target_component: 0_u8,
25591 frame: MavFrame::DEFAULT,
25592 };
25593 #[cfg(feature = "arbitrary")]
25594 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25595 use arbitrary::{Arbitrary, Unstructured};
25596 let mut buf = [0u8; 1024];
25597 rng.fill_bytes(&mut buf);
25598 let mut unstructured = Unstructured::new(&buf);
25599 Self::arbitrary(&mut unstructured).unwrap_or_default()
25600 }
25601}
25602impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
25603 fn default() -> Self {
25604 Self::DEFAULT.clone()
25605 }
25606}
25607impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
25608 type Message = MavMessage;
25609 const ID: u32 = 54u32;
25610 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
25611 const EXTRA_CRC: u8 = 15u8;
25612 const ENCODED_LEN: usize = 27usize;
25613 fn deser(
25614 _version: MavlinkVersion,
25615 __input: &[u8],
25616 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25617 let avail_len = __input.len();
25618 let mut payload_buf = [0; Self::ENCODED_LEN];
25619 let mut buf = if avail_len < Self::ENCODED_LEN {
25620 payload_buf[0..avail_len].copy_from_slice(__input);
25621 Bytes::new(&payload_buf)
25622 } else {
25623 Bytes::new(__input)
25624 };
25625 let mut __struct = Self::default();
25626 __struct.p1x = buf.get_f32_le();
25627 __struct.p1y = buf.get_f32_le();
25628 __struct.p1z = buf.get_f32_le();
25629 __struct.p2x = buf.get_f32_le();
25630 __struct.p2y = buf.get_f32_le();
25631 __struct.p2z = buf.get_f32_le();
25632 __struct.target_system = buf.get_u8();
25633 __struct.target_component = buf.get_u8();
25634 let tmp = buf.get_u8();
25635 __struct.frame =
25636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25637 enum_type: "MavFrame",
25638 value: tmp as u32,
25639 })?;
25640 Ok(__struct)
25641 }
25642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25643 let mut __tmp = BytesMut::new(bytes);
25644 #[allow(clippy::absurd_extreme_comparisons)]
25645 #[allow(unused_comparisons)]
25646 if __tmp.remaining() < Self::ENCODED_LEN {
25647 panic!(
25648 "buffer is too small (need {} bytes, but got {})",
25649 Self::ENCODED_LEN,
25650 __tmp.remaining(),
25651 )
25652 }
25653 __tmp.put_f32_le(self.p1x);
25654 __tmp.put_f32_le(self.p1y);
25655 __tmp.put_f32_le(self.p1z);
25656 __tmp.put_f32_le(self.p2x);
25657 __tmp.put_f32_le(self.p2y);
25658 __tmp.put_f32_le(self.p2z);
25659 __tmp.put_u8(self.target_system);
25660 __tmp.put_u8(self.target_component);
25661 __tmp.put_u8(self.frame as u8);
25662 if matches!(version, MavlinkVersion::V2) {
25663 let len = __tmp.len();
25664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25665 } else {
25666 __tmp.len()
25667 }
25668 }
25669}
25670#[doc = "id: 26"]
25671#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
25672#[derive(Debug, Clone, PartialEq)]
25673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25675pub struct SCALED_IMU_DATA {
25676 #[doc = "Timestamp (time since system boot)."]
25677 pub time_boot_ms: u32,
25678 #[doc = "X acceleration"]
25679 pub xacc: i16,
25680 #[doc = "Y acceleration"]
25681 pub yacc: i16,
25682 #[doc = "Z acceleration"]
25683 pub zacc: i16,
25684 #[doc = "Angular speed around X axis"]
25685 pub xgyro: i16,
25686 #[doc = "Angular speed around Y axis"]
25687 pub ygyro: i16,
25688 #[doc = "Angular speed around Z axis"]
25689 pub zgyro: i16,
25690 #[doc = "X Magnetic field"]
25691 pub xmag: i16,
25692 #[doc = "Y Magnetic field"]
25693 pub ymag: i16,
25694 #[doc = "Z Magnetic field"]
25695 pub zmag: i16,
25696 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25697 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25698 pub temperature: i16,
25699}
25700impl SCALED_IMU_DATA {
25701 pub const ENCODED_LEN: usize = 24usize;
25702 pub const DEFAULT: Self = Self {
25703 time_boot_ms: 0_u32,
25704 xacc: 0_i16,
25705 yacc: 0_i16,
25706 zacc: 0_i16,
25707 xgyro: 0_i16,
25708 ygyro: 0_i16,
25709 zgyro: 0_i16,
25710 xmag: 0_i16,
25711 ymag: 0_i16,
25712 zmag: 0_i16,
25713 temperature: 0_i16,
25714 };
25715 #[cfg(feature = "arbitrary")]
25716 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25717 use arbitrary::{Arbitrary, Unstructured};
25718 let mut buf = [0u8; 1024];
25719 rng.fill_bytes(&mut buf);
25720 let mut unstructured = Unstructured::new(&buf);
25721 Self::arbitrary(&mut unstructured).unwrap_or_default()
25722 }
25723}
25724impl Default for SCALED_IMU_DATA {
25725 fn default() -> Self {
25726 Self::DEFAULT.clone()
25727 }
25728}
25729impl MessageData for SCALED_IMU_DATA {
25730 type Message = MavMessage;
25731 const ID: u32 = 26u32;
25732 const NAME: &'static str = "SCALED_IMU";
25733 const EXTRA_CRC: u8 = 170u8;
25734 const ENCODED_LEN: usize = 24usize;
25735 fn deser(
25736 _version: MavlinkVersion,
25737 __input: &[u8],
25738 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25739 let avail_len = __input.len();
25740 let mut payload_buf = [0; Self::ENCODED_LEN];
25741 let mut buf = if avail_len < Self::ENCODED_LEN {
25742 payload_buf[0..avail_len].copy_from_slice(__input);
25743 Bytes::new(&payload_buf)
25744 } else {
25745 Bytes::new(__input)
25746 };
25747 let mut __struct = Self::default();
25748 __struct.time_boot_ms = buf.get_u32_le();
25749 __struct.xacc = buf.get_i16_le();
25750 __struct.yacc = buf.get_i16_le();
25751 __struct.zacc = buf.get_i16_le();
25752 __struct.xgyro = buf.get_i16_le();
25753 __struct.ygyro = buf.get_i16_le();
25754 __struct.zgyro = buf.get_i16_le();
25755 __struct.xmag = buf.get_i16_le();
25756 __struct.ymag = buf.get_i16_le();
25757 __struct.zmag = buf.get_i16_le();
25758 __struct.temperature = buf.get_i16_le();
25759 Ok(__struct)
25760 }
25761 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25762 let mut __tmp = BytesMut::new(bytes);
25763 #[allow(clippy::absurd_extreme_comparisons)]
25764 #[allow(unused_comparisons)]
25765 if __tmp.remaining() < Self::ENCODED_LEN {
25766 panic!(
25767 "buffer is too small (need {} bytes, but got {})",
25768 Self::ENCODED_LEN,
25769 __tmp.remaining(),
25770 )
25771 }
25772 __tmp.put_u32_le(self.time_boot_ms);
25773 __tmp.put_i16_le(self.xacc);
25774 __tmp.put_i16_le(self.yacc);
25775 __tmp.put_i16_le(self.zacc);
25776 __tmp.put_i16_le(self.xgyro);
25777 __tmp.put_i16_le(self.ygyro);
25778 __tmp.put_i16_le(self.zgyro);
25779 __tmp.put_i16_le(self.xmag);
25780 __tmp.put_i16_le(self.ymag);
25781 __tmp.put_i16_le(self.zmag);
25782 __tmp.put_i16_le(self.temperature);
25783 if matches!(version, MavlinkVersion::V2) {
25784 let len = __tmp.len();
25785 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25786 } else {
25787 __tmp.len()
25788 }
25789 }
25790}
25791#[doc = "id: 116"]
25792#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
25793#[derive(Debug, Clone, PartialEq)]
25794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25796pub struct SCALED_IMU2_DATA {
25797 #[doc = "Timestamp (time since system boot)."]
25798 pub time_boot_ms: u32,
25799 #[doc = "X acceleration"]
25800 pub xacc: i16,
25801 #[doc = "Y acceleration"]
25802 pub yacc: i16,
25803 #[doc = "Z acceleration"]
25804 pub zacc: i16,
25805 #[doc = "Angular speed around X axis"]
25806 pub xgyro: i16,
25807 #[doc = "Angular speed around Y axis"]
25808 pub ygyro: i16,
25809 #[doc = "Angular speed around Z axis"]
25810 pub zgyro: i16,
25811 #[doc = "X Magnetic field"]
25812 pub xmag: i16,
25813 #[doc = "Y Magnetic field"]
25814 pub ymag: i16,
25815 #[doc = "Z Magnetic field"]
25816 pub zmag: i16,
25817 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25819 pub temperature: i16,
25820}
25821impl SCALED_IMU2_DATA {
25822 pub const ENCODED_LEN: usize = 24usize;
25823 pub const DEFAULT: Self = Self {
25824 time_boot_ms: 0_u32,
25825 xacc: 0_i16,
25826 yacc: 0_i16,
25827 zacc: 0_i16,
25828 xgyro: 0_i16,
25829 ygyro: 0_i16,
25830 zgyro: 0_i16,
25831 xmag: 0_i16,
25832 ymag: 0_i16,
25833 zmag: 0_i16,
25834 temperature: 0_i16,
25835 };
25836 #[cfg(feature = "arbitrary")]
25837 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25838 use arbitrary::{Arbitrary, Unstructured};
25839 let mut buf = [0u8; 1024];
25840 rng.fill_bytes(&mut buf);
25841 let mut unstructured = Unstructured::new(&buf);
25842 Self::arbitrary(&mut unstructured).unwrap_or_default()
25843 }
25844}
25845impl Default for SCALED_IMU2_DATA {
25846 fn default() -> Self {
25847 Self::DEFAULT.clone()
25848 }
25849}
25850impl MessageData for SCALED_IMU2_DATA {
25851 type Message = MavMessage;
25852 const ID: u32 = 116u32;
25853 const NAME: &'static str = "SCALED_IMU2";
25854 const EXTRA_CRC: u8 = 76u8;
25855 const ENCODED_LEN: usize = 24usize;
25856 fn deser(
25857 _version: MavlinkVersion,
25858 __input: &[u8],
25859 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25860 let avail_len = __input.len();
25861 let mut payload_buf = [0; Self::ENCODED_LEN];
25862 let mut buf = if avail_len < Self::ENCODED_LEN {
25863 payload_buf[0..avail_len].copy_from_slice(__input);
25864 Bytes::new(&payload_buf)
25865 } else {
25866 Bytes::new(__input)
25867 };
25868 let mut __struct = Self::default();
25869 __struct.time_boot_ms = buf.get_u32_le();
25870 __struct.xacc = buf.get_i16_le();
25871 __struct.yacc = buf.get_i16_le();
25872 __struct.zacc = buf.get_i16_le();
25873 __struct.xgyro = buf.get_i16_le();
25874 __struct.ygyro = buf.get_i16_le();
25875 __struct.zgyro = buf.get_i16_le();
25876 __struct.xmag = buf.get_i16_le();
25877 __struct.ymag = buf.get_i16_le();
25878 __struct.zmag = buf.get_i16_le();
25879 __struct.temperature = buf.get_i16_le();
25880 Ok(__struct)
25881 }
25882 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25883 let mut __tmp = BytesMut::new(bytes);
25884 #[allow(clippy::absurd_extreme_comparisons)]
25885 #[allow(unused_comparisons)]
25886 if __tmp.remaining() < Self::ENCODED_LEN {
25887 panic!(
25888 "buffer is too small (need {} bytes, but got {})",
25889 Self::ENCODED_LEN,
25890 __tmp.remaining(),
25891 )
25892 }
25893 __tmp.put_u32_le(self.time_boot_ms);
25894 __tmp.put_i16_le(self.xacc);
25895 __tmp.put_i16_le(self.yacc);
25896 __tmp.put_i16_le(self.zacc);
25897 __tmp.put_i16_le(self.xgyro);
25898 __tmp.put_i16_le(self.ygyro);
25899 __tmp.put_i16_le(self.zgyro);
25900 __tmp.put_i16_le(self.xmag);
25901 __tmp.put_i16_le(self.ymag);
25902 __tmp.put_i16_le(self.zmag);
25903 __tmp.put_i16_le(self.temperature);
25904 if matches!(version, MavlinkVersion::V2) {
25905 let len = __tmp.len();
25906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25907 } else {
25908 __tmp.len()
25909 }
25910 }
25911}
25912#[doc = "id: 129"]
25913#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
25914#[derive(Debug, Clone, PartialEq)]
25915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25917pub struct SCALED_IMU3_DATA {
25918 #[doc = "Timestamp (time since system boot)."]
25919 pub time_boot_ms: u32,
25920 #[doc = "X acceleration"]
25921 pub xacc: i16,
25922 #[doc = "Y acceleration"]
25923 pub yacc: i16,
25924 #[doc = "Z acceleration"]
25925 pub zacc: i16,
25926 #[doc = "Angular speed around X axis"]
25927 pub xgyro: i16,
25928 #[doc = "Angular speed around Y axis"]
25929 pub ygyro: i16,
25930 #[doc = "Angular speed around Z axis"]
25931 pub zgyro: i16,
25932 #[doc = "X Magnetic field"]
25933 pub xmag: i16,
25934 #[doc = "Y Magnetic field"]
25935 pub ymag: i16,
25936 #[doc = "Z Magnetic field"]
25937 pub zmag: i16,
25938 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25939 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25940 pub temperature: i16,
25941}
25942impl SCALED_IMU3_DATA {
25943 pub const ENCODED_LEN: usize = 24usize;
25944 pub const DEFAULT: Self = Self {
25945 time_boot_ms: 0_u32,
25946 xacc: 0_i16,
25947 yacc: 0_i16,
25948 zacc: 0_i16,
25949 xgyro: 0_i16,
25950 ygyro: 0_i16,
25951 zgyro: 0_i16,
25952 xmag: 0_i16,
25953 ymag: 0_i16,
25954 zmag: 0_i16,
25955 temperature: 0_i16,
25956 };
25957 #[cfg(feature = "arbitrary")]
25958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25959 use arbitrary::{Arbitrary, Unstructured};
25960 let mut buf = [0u8; 1024];
25961 rng.fill_bytes(&mut buf);
25962 let mut unstructured = Unstructured::new(&buf);
25963 Self::arbitrary(&mut unstructured).unwrap_or_default()
25964 }
25965}
25966impl Default for SCALED_IMU3_DATA {
25967 fn default() -> Self {
25968 Self::DEFAULT.clone()
25969 }
25970}
25971impl MessageData for SCALED_IMU3_DATA {
25972 type Message = MavMessage;
25973 const ID: u32 = 129u32;
25974 const NAME: &'static str = "SCALED_IMU3";
25975 const EXTRA_CRC: u8 = 46u8;
25976 const ENCODED_LEN: usize = 24usize;
25977 fn deser(
25978 _version: MavlinkVersion,
25979 __input: &[u8],
25980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25981 let avail_len = __input.len();
25982 let mut payload_buf = [0; Self::ENCODED_LEN];
25983 let mut buf = if avail_len < Self::ENCODED_LEN {
25984 payload_buf[0..avail_len].copy_from_slice(__input);
25985 Bytes::new(&payload_buf)
25986 } else {
25987 Bytes::new(__input)
25988 };
25989 let mut __struct = Self::default();
25990 __struct.time_boot_ms = buf.get_u32_le();
25991 __struct.xacc = buf.get_i16_le();
25992 __struct.yacc = buf.get_i16_le();
25993 __struct.zacc = buf.get_i16_le();
25994 __struct.xgyro = buf.get_i16_le();
25995 __struct.ygyro = buf.get_i16_le();
25996 __struct.zgyro = buf.get_i16_le();
25997 __struct.xmag = buf.get_i16_le();
25998 __struct.ymag = buf.get_i16_le();
25999 __struct.zmag = buf.get_i16_le();
26000 __struct.temperature = buf.get_i16_le();
26001 Ok(__struct)
26002 }
26003 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26004 let mut __tmp = BytesMut::new(bytes);
26005 #[allow(clippy::absurd_extreme_comparisons)]
26006 #[allow(unused_comparisons)]
26007 if __tmp.remaining() < Self::ENCODED_LEN {
26008 panic!(
26009 "buffer is too small (need {} bytes, but got {})",
26010 Self::ENCODED_LEN,
26011 __tmp.remaining(),
26012 )
26013 }
26014 __tmp.put_u32_le(self.time_boot_ms);
26015 __tmp.put_i16_le(self.xacc);
26016 __tmp.put_i16_le(self.yacc);
26017 __tmp.put_i16_le(self.zacc);
26018 __tmp.put_i16_le(self.xgyro);
26019 __tmp.put_i16_le(self.ygyro);
26020 __tmp.put_i16_le(self.zgyro);
26021 __tmp.put_i16_le(self.xmag);
26022 __tmp.put_i16_le(self.ymag);
26023 __tmp.put_i16_le(self.zmag);
26024 __tmp.put_i16_le(self.temperature);
26025 if matches!(version, MavlinkVersion::V2) {
26026 let len = __tmp.len();
26027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26028 } else {
26029 __tmp.len()
26030 }
26031 }
26032}
26033#[doc = "id: 29"]
26034#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26035#[derive(Debug, Clone, PartialEq)]
26036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26038pub struct SCALED_PRESSURE_DATA {
26039 #[doc = "Timestamp (time since system boot)."]
26040 pub time_boot_ms: u32,
26041 #[doc = "Absolute pressure"]
26042 pub press_abs: f32,
26043 #[doc = "Differential pressure 1"]
26044 pub press_diff: f32,
26045 #[doc = "Absolute pressure temperature"]
26046 pub temperature: i16,
26047 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26048 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26049 pub temperature_press_diff: i16,
26050}
26051impl SCALED_PRESSURE_DATA {
26052 pub const ENCODED_LEN: usize = 16usize;
26053 pub const DEFAULT: Self = Self {
26054 time_boot_ms: 0_u32,
26055 press_abs: 0.0_f32,
26056 press_diff: 0.0_f32,
26057 temperature: 0_i16,
26058 temperature_press_diff: 0_i16,
26059 };
26060 #[cfg(feature = "arbitrary")]
26061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26062 use arbitrary::{Arbitrary, Unstructured};
26063 let mut buf = [0u8; 1024];
26064 rng.fill_bytes(&mut buf);
26065 let mut unstructured = Unstructured::new(&buf);
26066 Self::arbitrary(&mut unstructured).unwrap_or_default()
26067 }
26068}
26069impl Default for SCALED_PRESSURE_DATA {
26070 fn default() -> Self {
26071 Self::DEFAULT.clone()
26072 }
26073}
26074impl MessageData for SCALED_PRESSURE_DATA {
26075 type Message = MavMessage;
26076 const ID: u32 = 29u32;
26077 const NAME: &'static str = "SCALED_PRESSURE";
26078 const EXTRA_CRC: u8 = 115u8;
26079 const ENCODED_LEN: usize = 16usize;
26080 fn deser(
26081 _version: MavlinkVersion,
26082 __input: &[u8],
26083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26084 let avail_len = __input.len();
26085 let mut payload_buf = [0; Self::ENCODED_LEN];
26086 let mut buf = if avail_len < Self::ENCODED_LEN {
26087 payload_buf[0..avail_len].copy_from_slice(__input);
26088 Bytes::new(&payload_buf)
26089 } else {
26090 Bytes::new(__input)
26091 };
26092 let mut __struct = Self::default();
26093 __struct.time_boot_ms = buf.get_u32_le();
26094 __struct.press_abs = buf.get_f32_le();
26095 __struct.press_diff = buf.get_f32_le();
26096 __struct.temperature = buf.get_i16_le();
26097 __struct.temperature_press_diff = buf.get_i16_le();
26098 Ok(__struct)
26099 }
26100 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26101 let mut __tmp = BytesMut::new(bytes);
26102 #[allow(clippy::absurd_extreme_comparisons)]
26103 #[allow(unused_comparisons)]
26104 if __tmp.remaining() < Self::ENCODED_LEN {
26105 panic!(
26106 "buffer is too small (need {} bytes, but got {})",
26107 Self::ENCODED_LEN,
26108 __tmp.remaining(),
26109 )
26110 }
26111 __tmp.put_u32_le(self.time_boot_ms);
26112 __tmp.put_f32_le(self.press_abs);
26113 __tmp.put_f32_le(self.press_diff);
26114 __tmp.put_i16_le(self.temperature);
26115 __tmp.put_i16_le(self.temperature_press_diff);
26116 if matches!(version, MavlinkVersion::V2) {
26117 let len = __tmp.len();
26118 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26119 } else {
26120 __tmp.len()
26121 }
26122 }
26123}
26124#[doc = "id: 137"]
26125#[doc = "Barometer readings for 2nd barometer."]
26126#[derive(Debug, Clone, PartialEq)]
26127#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26128#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26129pub struct SCALED_PRESSURE2_DATA {
26130 #[doc = "Timestamp (time since system boot)."]
26131 pub time_boot_ms: u32,
26132 #[doc = "Absolute pressure"]
26133 pub press_abs: f32,
26134 #[doc = "Differential pressure"]
26135 pub press_diff: f32,
26136 #[doc = "Absolute pressure temperature"]
26137 pub temperature: i16,
26138 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26140 pub temperature_press_diff: i16,
26141}
26142impl SCALED_PRESSURE2_DATA {
26143 pub const ENCODED_LEN: usize = 16usize;
26144 pub const DEFAULT: Self = Self {
26145 time_boot_ms: 0_u32,
26146 press_abs: 0.0_f32,
26147 press_diff: 0.0_f32,
26148 temperature: 0_i16,
26149 temperature_press_diff: 0_i16,
26150 };
26151 #[cfg(feature = "arbitrary")]
26152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26153 use arbitrary::{Arbitrary, Unstructured};
26154 let mut buf = [0u8; 1024];
26155 rng.fill_bytes(&mut buf);
26156 let mut unstructured = Unstructured::new(&buf);
26157 Self::arbitrary(&mut unstructured).unwrap_or_default()
26158 }
26159}
26160impl Default for SCALED_PRESSURE2_DATA {
26161 fn default() -> Self {
26162 Self::DEFAULT.clone()
26163 }
26164}
26165impl MessageData for SCALED_PRESSURE2_DATA {
26166 type Message = MavMessage;
26167 const ID: u32 = 137u32;
26168 const NAME: &'static str = "SCALED_PRESSURE2";
26169 const EXTRA_CRC: u8 = 195u8;
26170 const ENCODED_LEN: usize = 16usize;
26171 fn deser(
26172 _version: MavlinkVersion,
26173 __input: &[u8],
26174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26175 let avail_len = __input.len();
26176 let mut payload_buf = [0; Self::ENCODED_LEN];
26177 let mut buf = if avail_len < Self::ENCODED_LEN {
26178 payload_buf[0..avail_len].copy_from_slice(__input);
26179 Bytes::new(&payload_buf)
26180 } else {
26181 Bytes::new(__input)
26182 };
26183 let mut __struct = Self::default();
26184 __struct.time_boot_ms = buf.get_u32_le();
26185 __struct.press_abs = buf.get_f32_le();
26186 __struct.press_diff = buf.get_f32_le();
26187 __struct.temperature = buf.get_i16_le();
26188 __struct.temperature_press_diff = buf.get_i16_le();
26189 Ok(__struct)
26190 }
26191 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26192 let mut __tmp = BytesMut::new(bytes);
26193 #[allow(clippy::absurd_extreme_comparisons)]
26194 #[allow(unused_comparisons)]
26195 if __tmp.remaining() < Self::ENCODED_LEN {
26196 panic!(
26197 "buffer is too small (need {} bytes, but got {})",
26198 Self::ENCODED_LEN,
26199 __tmp.remaining(),
26200 )
26201 }
26202 __tmp.put_u32_le(self.time_boot_ms);
26203 __tmp.put_f32_le(self.press_abs);
26204 __tmp.put_f32_le(self.press_diff);
26205 __tmp.put_i16_le(self.temperature);
26206 __tmp.put_i16_le(self.temperature_press_diff);
26207 if matches!(version, MavlinkVersion::V2) {
26208 let len = __tmp.len();
26209 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26210 } else {
26211 __tmp.len()
26212 }
26213 }
26214}
26215#[doc = "id: 143"]
26216#[doc = "Barometer readings for 3rd barometer."]
26217#[derive(Debug, Clone, PartialEq)]
26218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26220pub struct SCALED_PRESSURE3_DATA {
26221 #[doc = "Timestamp (time since system boot)."]
26222 pub time_boot_ms: u32,
26223 #[doc = "Absolute pressure"]
26224 pub press_abs: f32,
26225 #[doc = "Differential pressure"]
26226 pub press_diff: f32,
26227 #[doc = "Absolute pressure temperature"]
26228 pub temperature: i16,
26229 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26230 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26231 pub temperature_press_diff: i16,
26232}
26233impl SCALED_PRESSURE3_DATA {
26234 pub const ENCODED_LEN: usize = 16usize;
26235 pub const DEFAULT: Self = Self {
26236 time_boot_ms: 0_u32,
26237 press_abs: 0.0_f32,
26238 press_diff: 0.0_f32,
26239 temperature: 0_i16,
26240 temperature_press_diff: 0_i16,
26241 };
26242 #[cfg(feature = "arbitrary")]
26243 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26244 use arbitrary::{Arbitrary, Unstructured};
26245 let mut buf = [0u8; 1024];
26246 rng.fill_bytes(&mut buf);
26247 let mut unstructured = Unstructured::new(&buf);
26248 Self::arbitrary(&mut unstructured).unwrap_or_default()
26249 }
26250}
26251impl Default for SCALED_PRESSURE3_DATA {
26252 fn default() -> Self {
26253 Self::DEFAULT.clone()
26254 }
26255}
26256impl MessageData for SCALED_PRESSURE3_DATA {
26257 type Message = MavMessage;
26258 const ID: u32 = 143u32;
26259 const NAME: &'static str = "SCALED_PRESSURE3";
26260 const EXTRA_CRC: u8 = 131u8;
26261 const ENCODED_LEN: usize = 16usize;
26262 fn deser(
26263 _version: MavlinkVersion,
26264 __input: &[u8],
26265 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26266 let avail_len = __input.len();
26267 let mut payload_buf = [0; Self::ENCODED_LEN];
26268 let mut buf = if avail_len < Self::ENCODED_LEN {
26269 payload_buf[0..avail_len].copy_from_slice(__input);
26270 Bytes::new(&payload_buf)
26271 } else {
26272 Bytes::new(__input)
26273 };
26274 let mut __struct = Self::default();
26275 __struct.time_boot_ms = buf.get_u32_le();
26276 __struct.press_abs = buf.get_f32_le();
26277 __struct.press_diff = buf.get_f32_le();
26278 __struct.temperature = buf.get_i16_le();
26279 __struct.temperature_press_diff = buf.get_i16_le();
26280 Ok(__struct)
26281 }
26282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26283 let mut __tmp = BytesMut::new(bytes);
26284 #[allow(clippy::absurd_extreme_comparisons)]
26285 #[allow(unused_comparisons)]
26286 if __tmp.remaining() < Self::ENCODED_LEN {
26287 panic!(
26288 "buffer is too small (need {} bytes, but got {})",
26289 Self::ENCODED_LEN,
26290 __tmp.remaining(),
26291 )
26292 }
26293 __tmp.put_u32_le(self.time_boot_ms);
26294 __tmp.put_f32_le(self.press_abs);
26295 __tmp.put_f32_le(self.press_diff);
26296 __tmp.put_i16_le(self.temperature);
26297 __tmp.put_i16_le(self.temperature_press_diff);
26298 if matches!(version, MavlinkVersion::V2) {
26299 let len = __tmp.len();
26300 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26301 } else {
26302 __tmp.len()
26303 }
26304 }
26305}
26306#[doc = "id: 126"]
26307#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26308#[derive(Debug, Clone, PartialEq)]
26309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26311pub struct SERIAL_CONTROL_DATA {
26312 #[doc = "Baudrate of transfer. Zero means no change."]
26313 pub baudrate: u32,
26314 #[doc = "Timeout for reply data"]
26315 pub timeout: u16,
26316 #[doc = "Serial control device type."]
26317 pub device: SerialControlDev,
26318 #[doc = "Bitmap of serial control flags."]
26319 pub flags: SerialControlFlag,
26320 #[doc = "how many bytes in this transfer"]
26321 pub count: u8,
26322 #[doc = "serial data"]
26323 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26324 pub data: [u8; 70],
26325 #[doc = "System ID"]
26326 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26327 pub target_system: u8,
26328 #[doc = "Component ID"]
26329 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26330 pub target_component: u8,
26331}
26332impl SERIAL_CONTROL_DATA {
26333 pub const ENCODED_LEN: usize = 81usize;
26334 pub const DEFAULT: Self = Self {
26335 baudrate: 0_u32,
26336 timeout: 0_u16,
26337 device: SerialControlDev::DEFAULT,
26338 flags: SerialControlFlag::DEFAULT,
26339 count: 0_u8,
26340 data: [0_u8; 70usize],
26341 target_system: 0_u8,
26342 target_component: 0_u8,
26343 };
26344 #[cfg(feature = "arbitrary")]
26345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26346 use arbitrary::{Arbitrary, Unstructured};
26347 let mut buf = [0u8; 1024];
26348 rng.fill_bytes(&mut buf);
26349 let mut unstructured = Unstructured::new(&buf);
26350 Self::arbitrary(&mut unstructured).unwrap_or_default()
26351 }
26352}
26353impl Default for SERIAL_CONTROL_DATA {
26354 fn default() -> Self {
26355 Self::DEFAULT.clone()
26356 }
26357}
26358impl MessageData for SERIAL_CONTROL_DATA {
26359 type Message = MavMessage;
26360 const ID: u32 = 126u32;
26361 const NAME: &'static str = "SERIAL_CONTROL";
26362 const EXTRA_CRC: u8 = 220u8;
26363 const ENCODED_LEN: usize = 81usize;
26364 fn deser(
26365 _version: MavlinkVersion,
26366 __input: &[u8],
26367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26368 let avail_len = __input.len();
26369 let mut payload_buf = [0; Self::ENCODED_LEN];
26370 let mut buf = if avail_len < Self::ENCODED_LEN {
26371 payload_buf[0..avail_len].copy_from_slice(__input);
26372 Bytes::new(&payload_buf)
26373 } else {
26374 Bytes::new(__input)
26375 };
26376 let mut __struct = Self::default();
26377 __struct.baudrate = buf.get_u32_le();
26378 __struct.timeout = buf.get_u16_le();
26379 let tmp = buf.get_u8();
26380 __struct.device =
26381 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26382 enum_type: "SerialControlDev",
26383 value: tmp as u32,
26384 })?;
26385 let tmp = buf.get_u8();
26386 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26387 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26388 flag_type: "SerialControlFlag",
26389 value: tmp as u32,
26390 })?;
26391 __struct.count = buf.get_u8();
26392 for v in &mut __struct.data {
26393 let val = buf.get_u8();
26394 *v = val;
26395 }
26396 __struct.target_system = buf.get_u8();
26397 __struct.target_component = buf.get_u8();
26398 Ok(__struct)
26399 }
26400 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26401 let mut __tmp = BytesMut::new(bytes);
26402 #[allow(clippy::absurd_extreme_comparisons)]
26403 #[allow(unused_comparisons)]
26404 if __tmp.remaining() < Self::ENCODED_LEN {
26405 panic!(
26406 "buffer is too small (need {} bytes, but got {})",
26407 Self::ENCODED_LEN,
26408 __tmp.remaining(),
26409 )
26410 }
26411 __tmp.put_u32_le(self.baudrate);
26412 __tmp.put_u16_le(self.timeout);
26413 __tmp.put_u8(self.device as u8);
26414 __tmp.put_u8(self.flags.bits());
26415 __tmp.put_u8(self.count);
26416 for val in &self.data {
26417 __tmp.put_u8(*val);
26418 }
26419 __tmp.put_u8(self.target_system);
26420 __tmp.put_u8(self.target_component);
26421 if matches!(version, MavlinkVersion::V2) {
26422 let len = __tmp.len();
26423 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26424 } else {
26425 __tmp.len()
26426 }
26427 }
26428}
26429#[doc = "id: 36"]
26430#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26431#[derive(Debug, Clone, PartialEq)]
26432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26433#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26434pub struct SERVO_OUTPUT_RAW_DATA {
26435 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26436 pub time_usec: u32,
26437 #[doc = "Servo output 1 value"]
26438 pub servo1_raw: u16,
26439 #[doc = "Servo output 2 value"]
26440 pub servo2_raw: u16,
26441 #[doc = "Servo output 3 value"]
26442 pub servo3_raw: u16,
26443 #[doc = "Servo output 4 value"]
26444 pub servo4_raw: u16,
26445 #[doc = "Servo output 5 value"]
26446 pub servo5_raw: u16,
26447 #[doc = "Servo output 6 value"]
26448 pub servo6_raw: u16,
26449 #[doc = "Servo output 7 value"]
26450 pub servo7_raw: u16,
26451 #[doc = "Servo output 8 value"]
26452 pub servo8_raw: u16,
26453 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26454 pub port: u8,
26455 #[doc = "Servo output 9 value"]
26456 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26457 pub servo9_raw: u16,
26458 #[doc = "Servo output 10 value"]
26459 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26460 pub servo10_raw: u16,
26461 #[doc = "Servo output 11 value"]
26462 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26463 pub servo11_raw: u16,
26464 #[doc = "Servo output 12 value"]
26465 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26466 pub servo12_raw: u16,
26467 #[doc = "Servo output 13 value"]
26468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26469 pub servo13_raw: u16,
26470 #[doc = "Servo output 14 value"]
26471 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26472 pub servo14_raw: u16,
26473 #[doc = "Servo output 15 value"]
26474 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26475 pub servo15_raw: u16,
26476 #[doc = "Servo output 16 value"]
26477 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26478 pub servo16_raw: u16,
26479}
26480impl SERVO_OUTPUT_RAW_DATA {
26481 pub const ENCODED_LEN: usize = 37usize;
26482 pub const DEFAULT: Self = Self {
26483 time_usec: 0_u32,
26484 servo1_raw: 0_u16,
26485 servo2_raw: 0_u16,
26486 servo3_raw: 0_u16,
26487 servo4_raw: 0_u16,
26488 servo5_raw: 0_u16,
26489 servo6_raw: 0_u16,
26490 servo7_raw: 0_u16,
26491 servo8_raw: 0_u16,
26492 port: 0_u8,
26493 servo9_raw: 0_u16,
26494 servo10_raw: 0_u16,
26495 servo11_raw: 0_u16,
26496 servo12_raw: 0_u16,
26497 servo13_raw: 0_u16,
26498 servo14_raw: 0_u16,
26499 servo15_raw: 0_u16,
26500 servo16_raw: 0_u16,
26501 };
26502 #[cfg(feature = "arbitrary")]
26503 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26504 use arbitrary::{Arbitrary, Unstructured};
26505 let mut buf = [0u8; 1024];
26506 rng.fill_bytes(&mut buf);
26507 let mut unstructured = Unstructured::new(&buf);
26508 Self::arbitrary(&mut unstructured).unwrap_or_default()
26509 }
26510}
26511impl Default for SERVO_OUTPUT_RAW_DATA {
26512 fn default() -> Self {
26513 Self::DEFAULT.clone()
26514 }
26515}
26516impl MessageData for SERVO_OUTPUT_RAW_DATA {
26517 type Message = MavMessage;
26518 const ID: u32 = 36u32;
26519 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26520 const EXTRA_CRC: u8 = 222u8;
26521 const ENCODED_LEN: usize = 37usize;
26522 fn deser(
26523 _version: MavlinkVersion,
26524 __input: &[u8],
26525 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26526 let avail_len = __input.len();
26527 let mut payload_buf = [0; Self::ENCODED_LEN];
26528 let mut buf = if avail_len < Self::ENCODED_LEN {
26529 payload_buf[0..avail_len].copy_from_slice(__input);
26530 Bytes::new(&payload_buf)
26531 } else {
26532 Bytes::new(__input)
26533 };
26534 let mut __struct = Self::default();
26535 __struct.time_usec = buf.get_u32_le();
26536 __struct.servo1_raw = buf.get_u16_le();
26537 __struct.servo2_raw = buf.get_u16_le();
26538 __struct.servo3_raw = buf.get_u16_le();
26539 __struct.servo4_raw = buf.get_u16_le();
26540 __struct.servo5_raw = buf.get_u16_le();
26541 __struct.servo6_raw = buf.get_u16_le();
26542 __struct.servo7_raw = buf.get_u16_le();
26543 __struct.servo8_raw = buf.get_u16_le();
26544 __struct.port = buf.get_u8();
26545 __struct.servo9_raw = buf.get_u16_le();
26546 __struct.servo10_raw = buf.get_u16_le();
26547 __struct.servo11_raw = buf.get_u16_le();
26548 __struct.servo12_raw = buf.get_u16_le();
26549 __struct.servo13_raw = buf.get_u16_le();
26550 __struct.servo14_raw = buf.get_u16_le();
26551 __struct.servo15_raw = buf.get_u16_le();
26552 __struct.servo16_raw = buf.get_u16_le();
26553 Ok(__struct)
26554 }
26555 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26556 let mut __tmp = BytesMut::new(bytes);
26557 #[allow(clippy::absurd_extreme_comparisons)]
26558 #[allow(unused_comparisons)]
26559 if __tmp.remaining() < Self::ENCODED_LEN {
26560 panic!(
26561 "buffer is too small (need {} bytes, but got {})",
26562 Self::ENCODED_LEN,
26563 __tmp.remaining(),
26564 )
26565 }
26566 __tmp.put_u32_le(self.time_usec);
26567 __tmp.put_u16_le(self.servo1_raw);
26568 __tmp.put_u16_le(self.servo2_raw);
26569 __tmp.put_u16_le(self.servo3_raw);
26570 __tmp.put_u16_le(self.servo4_raw);
26571 __tmp.put_u16_le(self.servo5_raw);
26572 __tmp.put_u16_le(self.servo6_raw);
26573 __tmp.put_u16_le(self.servo7_raw);
26574 __tmp.put_u16_le(self.servo8_raw);
26575 __tmp.put_u8(self.port);
26576 __tmp.put_u16_le(self.servo9_raw);
26577 __tmp.put_u16_le(self.servo10_raw);
26578 __tmp.put_u16_le(self.servo11_raw);
26579 __tmp.put_u16_le(self.servo12_raw);
26580 __tmp.put_u16_le(self.servo13_raw);
26581 __tmp.put_u16_le(self.servo14_raw);
26582 __tmp.put_u16_le(self.servo15_raw);
26583 __tmp.put_u16_le(self.servo16_raw);
26584 if matches!(version, MavlinkVersion::V2) {
26585 let len = __tmp.len();
26586 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26587 } else {
26588 __tmp.len()
26589 }
26590 }
26591}
26592#[doc = "id: 256"]
26593#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
26594#[derive(Debug, Clone, PartialEq)]
26595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26597pub struct SETUP_SIGNING_DATA {
26598 #[doc = "initial timestamp"]
26599 pub initial_timestamp: u64,
26600 #[doc = "system id of the target"]
26601 pub target_system: u8,
26602 #[doc = "component ID of the target"]
26603 pub target_component: u8,
26604 #[doc = "signing key"]
26605 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26606 pub secret_key: [u8; 32],
26607}
26608impl SETUP_SIGNING_DATA {
26609 pub const ENCODED_LEN: usize = 42usize;
26610 pub const DEFAULT: Self = Self {
26611 initial_timestamp: 0_u64,
26612 target_system: 0_u8,
26613 target_component: 0_u8,
26614 secret_key: [0_u8; 32usize],
26615 };
26616 #[cfg(feature = "arbitrary")]
26617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26618 use arbitrary::{Arbitrary, Unstructured};
26619 let mut buf = [0u8; 1024];
26620 rng.fill_bytes(&mut buf);
26621 let mut unstructured = Unstructured::new(&buf);
26622 Self::arbitrary(&mut unstructured).unwrap_or_default()
26623 }
26624}
26625impl Default for SETUP_SIGNING_DATA {
26626 fn default() -> Self {
26627 Self::DEFAULT.clone()
26628 }
26629}
26630impl MessageData for SETUP_SIGNING_DATA {
26631 type Message = MavMessage;
26632 const ID: u32 = 256u32;
26633 const NAME: &'static str = "SETUP_SIGNING";
26634 const EXTRA_CRC: u8 = 71u8;
26635 const ENCODED_LEN: usize = 42usize;
26636 fn deser(
26637 _version: MavlinkVersion,
26638 __input: &[u8],
26639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26640 let avail_len = __input.len();
26641 let mut payload_buf = [0; Self::ENCODED_LEN];
26642 let mut buf = if avail_len < Self::ENCODED_LEN {
26643 payload_buf[0..avail_len].copy_from_slice(__input);
26644 Bytes::new(&payload_buf)
26645 } else {
26646 Bytes::new(__input)
26647 };
26648 let mut __struct = Self::default();
26649 __struct.initial_timestamp = buf.get_u64_le();
26650 __struct.target_system = buf.get_u8();
26651 __struct.target_component = buf.get_u8();
26652 for v in &mut __struct.secret_key {
26653 let val = buf.get_u8();
26654 *v = val;
26655 }
26656 Ok(__struct)
26657 }
26658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26659 let mut __tmp = BytesMut::new(bytes);
26660 #[allow(clippy::absurd_extreme_comparisons)]
26661 #[allow(unused_comparisons)]
26662 if __tmp.remaining() < Self::ENCODED_LEN {
26663 panic!(
26664 "buffer is too small (need {} bytes, but got {})",
26665 Self::ENCODED_LEN,
26666 __tmp.remaining(),
26667 )
26668 }
26669 __tmp.put_u64_le(self.initial_timestamp);
26670 __tmp.put_u8(self.target_system);
26671 __tmp.put_u8(self.target_component);
26672 for val in &self.secret_key {
26673 __tmp.put_u8(*val);
26674 }
26675 if matches!(version, MavlinkVersion::V2) {
26676 let len = __tmp.len();
26677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26678 } else {
26679 __tmp.len()
26680 }
26681 }
26682}
26683#[doc = "id: 139"]
26684#[doc = "Set the vehicle attitude and body angular rates."]
26685#[derive(Debug, Clone, PartialEq)]
26686#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26687#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26688pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
26689 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26690 pub time_usec: u64,
26691 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
26692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26693 pub controls: [f32; 8],
26694 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
26695 pub group_mlx: u8,
26696 #[doc = "System ID"]
26697 pub target_system: u8,
26698 #[doc = "Component ID"]
26699 pub target_component: u8,
26700}
26701impl SET_ACTUATOR_CONTROL_TARGET_DATA {
26702 pub const ENCODED_LEN: usize = 43usize;
26703 pub const DEFAULT: Self = Self {
26704 time_usec: 0_u64,
26705 controls: [0.0_f32; 8usize],
26706 group_mlx: 0_u8,
26707 target_system: 0_u8,
26708 target_component: 0_u8,
26709 };
26710 #[cfg(feature = "arbitrary")]
26711 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26712 use arbitrary::{Arbitrary, Unstructured};
26713 let mut buf = [0u8; 1024];
26714 rng.fill_bytes(&mut buf);
26715 let mut unstructured = Unstructured::new(&buf);
26716 Self::arbitrary(&mut unstructured).unwrap_or_default()
26717 }
26718}
26719impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
26720 fn default() -> Self {
26721 Self::DEFAULT.clone()
26722 }
26723}
26724impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
26725 type Message = MavMessage;
26726 const ID: u32 = 139u32;
26727 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
26728 const EXTRA_CRC: u8 = 168u8;
26729 const ENCODED_LEN: usize = 43usize;
26730 fn deser(
26731 _version: MavlinkVersion,
26732 __input: &[u8],
26733 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26734 let avail_len = __input.len();
26735 let mut payload_buf = [0; Self::ENCODED_LEN];
26736 let mut buf = if avail_len < Self::ENCODED_LEN {
26737 payload_buf[0..avail_len].copy_from_slice(__input);
26738 Bytes::new(&payload_buf)
26739 } else {
26740 Bytes::new(__input)
26741 };
26742 let mut __struct = Self::default();
26743 __struct.time_usec = buf.get_u64_le();
26744 for v in &mut __struct.controls {
26745 let val = buf.get_f32_le();
26746 *v = val;
26747 }
26748 __struct.group_mlx = buf.get_u8();
26749 __struct.target_system = buf.get_u8();
26750 __struct.target_component = buf.get_u8();
26751 Ok(__struct)
26752 }
26753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26754 let mut __tmp = BytesMut::new(bytes);
26755 #[allow(clippy::absurd_extreme_comparisons)]
26756 #[allow(unused_comparisons)]
26757 if __tmp.remaining() < Self::ENCODED_LEN {
26758 panic!(
26759 "buffer is too small (need {} bytes, but got {})",
26760 Self::ENCODED_LEN,
26761 __tmp.remaining(),
26762 )
26763 }
26764 __tmp.put_u64_le(self.time_usec);
26765 for val in &self.controls {
26766 __tmp.put_f32_le(*val);
26767 }
26768 __tmp.put_u8(self.group_mlx);
26769 __tmp.put_u8(self.target_system);
26770 __tmp.put_u8(self.target_component);
26771 if matches!(version, MavlinkVersion::V2) {
26772 let len = __tmp.len();
26773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26774 } else {
26775 __tmp.len()
26776 }
26777 }
26778}
26779#[doc = "id: 82"]
26780#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
26781#[derive(Debug, Clone, PartialEq)]
26782#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26783#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26784pub struct SET_ATTITUDE_TARGET_DATA {
26785 #[doc = "Timestamp (time since system boot)."]
26786 pub time_boot_ms: u32,
26787 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
26788 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26789 pub q: [f32; 4],
26790 #[doc = "Body roll rate"]
26791 pub body_roll_rate: f32,
26792 #[doc = "Body pitch rate"]
26793 pub body_pitch_rate: f32,
26794 #[doc = "Body yaw rate"]
26795 pub body_yaw_rate: f32,
26796 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
26797 pub thrust: f32,
26798 #[doc = "System ID"]
26799 pub target_system: u8,
26800 #[doc = "Component ID"]
26801 pub target_component: u8,
26802 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
26803 pub type_mask: AttitudeTargetTypemask,
26804 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
26805 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26806 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26807 pub thrust_body: [f32; 3],
26808}
26809impl SET_ATTITUDE_TARGET_DATA {
26810 pub const ENCODED_LEN: usize = 51usize;
26811 pub const DEFAULT: Self = Self {
26812 time_boot_ms: 0_u32,
26813 q: [0.0_f32; 4usize],
26814 body_roll_rate: 0.0_f32,
26815 body_pitch_rate: 0.0_f32,
26816 body_yaw_rate: 0.0_f32,
26817 thrust: 0.0_f32,
26818 target_system: 0_u8,
26819 target_component: 0_u8,
26820 type_mask: AttitudeTargetTypemask::DEFAULT,
26821 thrust_body: [0.0_f32; 3usize],
26822 };
26823 #[cfg(feature = "arbitrary")]
26824 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26825 use arbitrary::{Arbitrary, Unstructured};
26826 let mut buf = [0u8; 1024];
26827 rng.fill_bytes(&mut buf);
26828 let mut unstructured = Unstructured::new(&buf);
26829 Self::arbitrary(&mut unstructured).unwrap_or_default()
26830 }
26831}
26832impl Default for SET_ATTITUDE_TARGET_DATA {
26833 fn default() -> Self {
26834 Self::DEFAULT.clone()
26835 }
26836}
26837impl MessageData for SET_ATTITUDE_TARGET_DATA {
26838 type Message = MavMessage;
26839 const ID: u32 = 82u32;
26840 const NAME: &'static str = "SET_ATTITUDE_TARGET";
26841 const EXTRA_CRC: u8 = 49u8;
26842 const ENCODED_LEN: usize = 51usize;
26843 fn deser(
26844 _version: MavlinkVersion,
26845 __input: &[u8],
26846 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26847 let avail_len = __input.len();
26848 let mut payload_buf = [0; Self::ENCODED_LEN];
26849 let mut buf = if avail_len < Self::ENCODED_LEN {
26850 payload_buf[0..avail_len].copy_from_slice(__input);
26851 Bytes::new(&payload_buf)
26852 } else {
26853 Bytes::new(__input)
26854 };
26855 let mut __struct = Self::default();
26856 __struct.time_boot_ms = buf.get_u32_le();
26857 for v in &mut __struct.q {
26858 let val = buf.get_f32_le();
26859 *v = val;
26860 }
26861 __struct.body_roll_rate = buf.get_f32_le();
26862 __struct.body_pitch_rate = buf.get_f32_le();
26863 __struct.body_yaw_rate = buf.get_f32_le();
26864 __struct.thrust = buf.get_f32_le();
26865 __struct.target_system = buf.get_u8();
26866 __struct.target_component = buf.get_u8();
26867 let tmp = buf.get_u8();
26868 __struct.type_mask = AttitudeTargetTypemask::from_bits(
26869 tmp & AttitudeTargetTypemask::all().bits(),
26870 )
26871 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26872 flag_type: "AttitudeTargetTypemask",
26873 value: tmp as u32,
26874 })?;
26875 for v in &mut __struct.thrust_body {
26876 let val = buf.get_f32_le();
26877 *v = val;
26878 }
26879 Ok(__struct)
26880 }
26881 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26882 let mut __tmp = BytesMut::new(bytes);
26883 #[allow(clippy::absurd_extreme_comparisons)]
26884 #[allow(unused_comparisons)]
26885 if __tmp.remaining() < Self::ENCODED_LEN {
26886 panic!(
26887 "buffer is too small (need {} bytes, but got {})",
26888 Self::ENCODED_LEN,
26889 __tmp.remaining(),
26890 )
26891 }
26892 __tmp.put_u32_le(self.time_boot_ms);
26893 for val in &self.q {
26894 __tmp.put_f32_le(*val);
26895 }
26896 __tmp.put_f32_le(self.body_roll_rate);
26897 __tmp.put_f32_le(self.body_pitch_rate);
26898 __tmp.put_f32_le(self.body_yaw_rate);
26899 __tmp.put_f32_le(self.thrust);
26900 __tmp.put_u8(self.target_system);
26901 __tmp.put_u8(self.target_component);
26902 __tmp.put_u8(self.type_mask.bits());
26903 for val in &self.thrust_body {
26904 __tmp.put_f32_le(*val);
26905 }
26906 if matches!(version, MavlinkVersion::V2) {
26907 let len = __tmp.len();
26908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26909 } else {
26910 __tmp.len()
26911 }
26912 }
26913}
26914#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
26915#[doc = "id: 48"]
26916#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
26917#[derive(Debug, Clone, PartialEq)]
26918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26920pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
26921 #[doc = "Latitude (WGS84)"]
26922 pub latitude: i32,
26923 #[doc = "Longitude (WGS84)"]
26924 pub longitude: i32,
26925 #[doc = "Altitude (MSL). Positive for up."]
26926 pub altitude: i32,
26927 #[doc = "System ID"]
26928 pub target_system: u8,
26929 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26930 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26931 pub time_usec: u64,
26932}
26933impl SET_GPS_GLOBAL_ORIGIN_DATA {
26934 pub const ENCODED_LEN: usize = 21usize;
26935 pub const DEFAULT: Self = Self {
26936 latitude: 0_i32,
26937 longitude: 0_i32,
26938 altitude: 0_i32,
26939 target_system: 0_u8,
26940 time_usec: 0_u64,
26941 };
26942 #[cfg(feature = "arbitrary")]
26943 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26944 use arbitrary::{Arbitrary, Unstructured};
26945 let mut buf = [0u8; 1024];
26946 rng.fill_bytes(&mut buf);
26947 let mut unstructured = Unstructured::new(&buf);
26948 Self::arbitrary(&mut unstructured).unwrap_or_default()
26949 }
26950}
26951impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
26952 fn default() -> Self {
26953 Self::DEFAULT.clone()
26954 }
26955}
26956impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
26957 type Message = MavMessage;
26958 const ID: u32 = 48u32;
26959 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
26960 const EXTRA_CRC: u8 = 41u8;
26961 const ENCODED_LEN: usize = 21usize;
26962 fn deser(
26963 _version: MavlinkVersion,
26964 __input: &[u8],
26965 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26966 let avail_len = __input.len();
26967 let mut payload_buf = [0; Self::ENCODED_LEN];
26968 let mut buf = if avail_len < Self::ENCODED_LEN {
26969 payload_buf[0..avail_len].copy_from_slice(__input);
26970 Bytes::new(&payload_buf)
26971 } else {
26972 Bytes::new(__input)
26973 };
26974 let mut __struct = Self::default();
26975 __struct.latitude = buf.get_i32_le();
26976 __struct.longitude = buf.get_i32_le();
26977 __struct.altitude = buf.get_i32_le();
26978 __struct.target_system = buf.get_u8();
26979 __struct.time_usec = buf.get_u64_le();
26980 Ok(__struct)
26981 }
26982 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26983 let mut __tmp = BytesMut::new(bytes);
26984 #[allow(clippy::absurd_extreme_comparisons)]
26985 #[allow(unused_comparisons)]
26986 if __tmp.remaining() < Self::ENCODED_LEN {
26987 panic!(
26988 "buffer is too small (need {} bytes, but got {})",
26989 Self::ENCODED_LEN,
26990 __tmp.remaining(),
26991 )
26992 }
26993 __tmp.put_i32_le(self.latitude);
26994 __tmp.put_i32_le(self.longitude);
26995 __tmp.put_i32_le(self.altitude);
26996 __tmp.put_u8(self.target_system);
26997 __tmp.put_u64_le(self.time_usec);
26998 if matches!(version, MavlinkVersion::V2) {
26999 let len = __tmp.len();
27000 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27001 } else {
27002 __tmp.len()
27003 }
27004 }
27005}
27006#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27007#[doc = "id: 243"]
27008#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27009#[derive(Debug, Clone, PartialEq)]
27010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27012pub struct SET_HOME_POSITION_DATA {
27013 #[doc = "Latitude (WGS84)"]
27014 pub latitude: i32,
27015 #[doc = "Longitude (WGS84)"]
27016 pub longitude: i32,
27017 #[doc = "Altitude (MSL). Positive for up."]
27018 pub altitude: i32,
27019 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27020 pub x: f32,
27021 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27022 pub y: f32,
27023 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27024 pub z: f32,
27025 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27026 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27027 pub q: [f32; 4],
27028 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27029 pub approach_x: f32,
27030 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27031 pub approach_y: f32,
27032 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27033 pub approach_z: f32,
27034 #[doc = "System ID."]
27035 pub target_system: u8,
27036 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27037 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27038 pub time_usec: u64,
27039}
27040impl SET_HOME_POSITION_DATA {
27041 pub const ENCODED_LEN: usize = 61usize;
27042 pub const DEFAULT: Self = Self {
27043 latitude: 0_i32,
27044 longitude: 0_i32,
27045 altitude: 0_i32,
27046 x: 0.0_f32,
27047 y: 0.0_f32,
27048 z: 0.0_f32,
27049 q: [0.0_f32; 4usize],
27050 approach_x: 0.0_f32,
27051 approach_y: 0.0_f32,
27052 approach_z: 0.0_f32,
27053 target_system: 0_u8,
27054 time_usec: 0_u64,
27055 };
27056 #[cfg(feature = "arbitrary")]
27057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27058 use arbitrary::{Arbitrary, Unstructured};
27059 let mut buf = [0u8; 1024];
27060 rng.fill_bytes(&mut buf);
27061 let mut unstructured = Unstructured::new(&buf);
27062 Self::arbitrary(&mut unstructured).unwrap_or_default()
27063 }
27064}
27065impl Default for SET_HOME_POSITION_DATA {
27066 fn default() -> Self {
27067 Self::DEFAULT.clone()
27068 }
27069}
27070impl MessageData for SET_HOME_POSITION_DATA {
27071 type Message = MavMessage;
27072 const ID: u32 = 243u32;
27073 const NAME: &'static str = "SET_HOME_POSITION";
27074 const EXTRA_CRC: u8 = 85u8;
27075 const ENCODED_LEN: usize = 61usize;
27076 fn deser(
27077 _version: MavlinkVersion,
27078 __input: &[u8],
27079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27080 let avail_len = __input.len();
27081 let mut payload_buf = [0; Self::ENCODED_LEN];
27082 let mut buf = if avail_len < Self::ENCODED_LEN {
27083 payload_buf[0..avail_len].copy_from_slice(__input);
27084 Bytes::new(&payload_buf)
27085 } else {
27086 Bytes::new(__input)
27087 };
27088 let mut __struct = Self::default();
27089 __struct.latitude = buf.get_i32_le();
27090 __struct.longitude = buf.get_i32_le();
27091 __struct.altitude = buf.get_i32_le();
27092 __struct.x = buf.get_f32_le();
27093 __struct.y = buf.get_f32_le();
27094 __struct.z = buf.get_f32_le();
27095 for v in &mut __struct.q {
27096 let val = buf.get_f32_le();
27097 *v = val;
27098 }
27099 __struct.approach_x = buf.get_f32_le();
27100 __struct.approach_y = buf.get_f32_le();
27101 __struct.approach_z = buf.get_f32_le();
27102 __struct.target_system = buf.get_u8();
27103 __struct.time_usec = buf.get_u64_le();
27104 Ok(__struct)
27105 }
27106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27107 let mut __tmp = BytesMut::new(bytes);
27108 #[allow(clippy::absurd_extreme_comparisons)]
27109 #[allow(unused_comparisons)]
27110 if __tmp.remaining() < Self::ENCODED_LEN {
27111 panic!(
27112 "buffer is too small (need {} bytes, but got {})",
27113 Self::ENCODED_LEN,
27114 __tmp.remaining(),
27115 )
27116 }
27117 __tmp.put_i32_le(self.latitude);
27118 __tmp.put_i32_le(self.longitude);
27119 __tmp.put_i32_le(self.altitude);
27120 __tmp.put_f32_le(self.x);
27121 __tmp.put_f32_le(self.y);
27122 __tmp.put_f32_le(self.z);
27123 for val in &self.q {
27124 __tmp.put_f32_le(*val);
27125 }
27126 __tmp.put_f32_le(self.approach_x);
27127 __tmp.put_f32_le(self.approach_y);
27128 __tmp.put_f32_le(self.approach_z);
27129 __tmp.put_u8(self.target_system);
27130 __tmp.put_u64_le(self.time_usec);
27131 if matches!(version, MavlinkVersion::V2) {
27132 let len = __tmp.len();
27133 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27134 } else {
27135 __tmp.len()
27136 }
27137 }
27138}
27139#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27140#[doc = "id: 11"]
27141#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27142#[derive(Debug, Clone, PartialEq)]
27143#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27144#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27145pub struct SET_MODE_DATA {
27146 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27147 pub custom_mode: u32,
27148 #[doc = "The system setting the mode"]
27149 pub target_system: u8,
27150 #[doc = "The new base mode."]
27151 pub base_mode: MavMode,
27152}
27153impl SET_MODE_DATA {
27154 pub const ENCODED_LEN: usize = 6usize;
27155 pub const DEFAULT: Self = Self {
27156 custom_mode: 0_u32,
27157 target_system: 0_u8,
27158 base_mode: MavMode::DEFAULT,
27159 };
27160 #[cfg(feature = "arbitrary")]
27161 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27162 use arbitrary::{Arbitrary, Unstructured};
27163 let mut buf = [0u8; 1024];
27164 rng.fill_bytes(&mut buf);
27165 let mut unstructured = Unstructured::new(&buf);
27166 Self::arbitrary(&mut unstructured).unwrap_or_default()
27167 }
27168}
27169impl Default for SET_MODE_DATA {
27170 fn default() -> Self {
27171 Self::DEFAULT.clone()
27172 }
27173}
27174impl MessageData for SET_MODE_DATA {
27175 type Message = MavMessage;
27176 const ID: u32 = 11u32;
27177 const NAME: &'static str = "SET_MODE";
27178 const EXTRA_CRC: u8 = 89u8;
27179 const ENCODED_LEN: usize = 6usize;
27180 fn deser(
27181 _version: MavlinkVersion,
27182 __input: &[u8],
27183 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27184 let avail_len = __input.len();
27185 let mut payload_buf = [0; Self::ENCODED_LEN];
27186 let mut buf = if avail_len < Self::ENCODED_LEN {
27187 payload_buf[0..avail_len].copy_from_slice(__input);
27188 Bytes::new(&payload_buf)
27189 } else {
27190 Bytes::new(__input)
27191 };
27192 let mut __struct = Self::default();
27193 __struct.custom_mode = buf.get_u32_le();
27194 __struct.target_system = buf.get_u8();
27195 let tmp = buf.get_u8();
27196 __struct.base_mode =
27197 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27198 enum_type: "MavMode",
27199 value: tmp as u32,
27200 })?;
27201 Ok(__struct)
27202 }
27203 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27204 let mut __tmp = BytesMut::new(bytes);
27205 #[allow(clippy::absurd_extreme_comparisons)]
27206 #[allow(unused_comparisons)]
27207 if __tmp.remaining() < Self::ENCODED_LEN {
27208 panic!(
27209 "buffer is too small (need {} bytes, but got {})",
27210 Self::ENCODED_LEN,
27211 __tmp.remaining(),
27212 )
27213 }
27214 __tmp.put_u32_le(self.custom_mode);
27215 __tmp.put_u8(self.target_system);
27216 __tmp.put_u8(self.base_mode as u8);
27217 if matches!(version, MavlinkVersion::V2) {
27218 let len = __tmp.len();
27219 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27220 } else {
27221 __tmp.len()
27222 }
27223 }
27224}
27225#[doc = "id: 86"]
27226#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27227#[derive(Debug, Clone, PartialEq)]
27228#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27230pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27231 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27232 pub time_boot_ms: u32,
27233 #[doc = "Latitude in WGS84 frame"]
27234 pub lat_int: i32,
27235 #[doc = "Longitude in WGS84 frame"]
27236 pub lon_int: i32,
27237 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27238 pub alt: f32,
27239 #[doc = "X velocity in NED frame"]
27240 pub vx: f32,
27241 #[doc = "Y velocity in NED frame"]
27242 pub vy: f32,
27243 #[doc = "Z velocity in NED frame"]
27244 pub vz: f32,
27245 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27246 pub afx: f32,
27247 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27248 pub afy: f32,
27249 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27250 pub afz: f32,
27251 #[doc = "yaw setpoint"]
27252 pub yaw: f32,
27253 #[doc = "yaw rate setpoint"]
27254 pub yaw_rate: f32,
27255 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27256 pub type_mask: PositionTargetTypemask,
27257 #[doc = "System ID"]
27258 pub target_system: u8,
27259 #[doc = "Component ID"]
27260 pub target_component: u8,
27261 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27262 pub coordinate_frame: MavFrame,
27263}
27264impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27265 pub const ENCODED_LEN: usize = 53usize;
27266 pub const DEFAULT: Self = Self {
27267 time_boot_ms: 0_u32,
27268 lat_int: 0_i32,
27269 lon_int: 0_i32,
27270 alt: 0.0_f32,
27271 vx: 0.0_f32,
27272 vy: 0.0_f32,
27273 vz: 0.0_f32,
27274 afx: 0.0_f32,
27275 afy: 0.0_f32,
27276 afz: 0.0_f32,
27277 yaw: 0.0_f32,
27278 yaw_rate: 0.0_f32,
27279 type_mask: PositionTargetTypemask::DEFAULT,
27280 target_system: 0_u8,
27281 target_component: 0_u8,
27282 coordinate_frame: MavFrame::DEFAULT,
27283 };
27284 #[cfg(feature = "arbitrary")]
27285 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27286 use arbitrary::{Arbitrary, Unstructured};
27287 let mut buf = [0u8; 1024];
27288 rng.fill_bytes(&mut buf);
27289 let mut unstructured = Unstructured::new(&buf);
27290 Self::arbitrary(&mut unstructured).unwrap_or_default()
27291 }
27292}
27293impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27294 fn default() -> Self {
27295 Self::DEFAULT.clone()
27296 }
27297}
27298impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27299 type Message = MavMessage;
27300 const ID: u32 = 86u32;
27301 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27302 const EXTRA_CRC: u8 = 5u8;
27303 const ENCODED_LEN: usize = 53usize;
27304 fn deser(
27305 _version: MavlinkVersion,
27306 __input: &[u8],
27307 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27308 let avail_len = __input.len();
27309 let mut payload_buf = [0; Self::ENCODED_LEN];
27310 let mut buf = if avail_len < Self::ENCODED_LEN {
27311 payload_buf[0..avail_len].copy_from_slice(__input);
27312 Bytes::new(&payload_buf)
27313 } else {
27314 Bytes::new(__input)
27315 };
27316 let mut __struct = Self::default();
27317 __struct.time_boot_ms = buf.get_u32_le();
27318 __struct.lat_int = buf.get_i32_le();
27319 __struct.lon_int = buf.get_i32_le();
27320 __struct.alt = buf.get_f32_le();
27321 __struct.vx = buf.get_f32_le();
27322 __struct.vy = buf.get_f32_le();
27323 __struct.vz = buf.get_f32_le();
27324 __struct.afx = buf.get_f32_le();
27325 __struct.afy = buf.get_f32_le();
27326 __struct.afz = buf.get_f32_le();
27327 __struct.yaw = buf.get_f32_le();
27328 __struct.yaw_rate = buf.get_f32_le();
27329 let tmp = buf.get_u16_le();
27330 __struct.type_mask = PositionTargetTypemask::from_bits(
27331 tmp & PositionTargetTypemask::all().bits(),
27332 )
27333 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27334 flag_type: "PositionTargetTypemask",
27335 value: tmp as u32,
27336 })?;
27337 __struct.target_system = buf.get_u8();
27338 __struct.target_component = buf.get_u8();
27339 let tmp = buf.get_u8();
27340 __struct.coordinate_frame =
27341 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27342 enum_type: "MavFrame",
27343 value: tmp as u32,
27344 })?;
27345 Ok(__struct)
27346 }
27347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27348 let mut __tmp = BytesMut::new(bytes);
27349 #[allow(clippy::absurd_extreme_comparisons)]
27350 #[allow(unused_comparisons)]
27351 if __tmp.remaining() < Self::ENCODED_LEN {
27352 panic!(
27353 "buffer is too small (need {} bytes, but got {})",
27354 Self::ENCODED_LEN,
27355 __tmp.remaining(),
27356 )
27357 }
27358 __tmp.put_u32_le(self.time_boot_ms);
27359 __tmp.put_i32_le(self.lat_int);
27360 __tmp.put_i32_le(self.lon_int);
27361 __tmp.put_f32_le(self.alt);
27362 __tmp.put_f32_le(self.vx);
27363 __tmp.put_f32_le(self.vy);
27364 __tmp.put_f32_le(self.vz);
27365 __tmp.put_f32_le(self.afx);
27366 __tmp.put_f32_le(self.afy);
27367 __tmp.put_f32_le(self.afz);
27368 __tmp.put_f32_le(self.yaw);
27369 __tmp.put_f32_le(self.yaw_rate);
27370 __tmp.put_u16_le(self.type_mask.bits());
27371 __tmp.put_u8(self.target_system);
27372 __tmp.put_u8(self.target_component);
27373 __tmp.put_u8(self.coordinate_frame as u8);
27374 if matches!(version, MavlinkVersion::V2) {
27375 let len = __tmp.len();
27376 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27377 } else {
27378 __tmp.len()
27379 }
27380 }
27381}
27382#[doc = "id: 84"]
27383#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27384#[derive(Debug, Clone, PartialEq)]
27385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27387pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27388 #[doc = "Timestamp (time since system boot)."]
27389 pub time_boot_ms: u32,
27390 #[doc = "X Position in NED frame"]
27391 pub x: f32,
27392 #[doc = "Y Position in NED frame"]
27393 pub y: f32,
27394 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27395 pub z: f32,
27396 #[doc = "X velocity in NED frame"]
27397 pub vx: f32,
27398 #[doc = "Y velocity in NED frame"]
27399 pub vy: f32,
27400 #[doc = "Z velocity in NED frame"]
27401 pub vz: f32,
27402 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27403 pub afx: f32,
27404 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27405 pub afy: f32,
27406 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27407 pub afz: f32,
27408 #[doc = "yaw setpoint"]
27409 pub yaw: f32,
27410 #[doc = "yaw rate setpoint"]
27411 pub yaw_rate: f32,
27412 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27413 pub type_mask: PositionTargetTypemask,
27414 #[doc = "System ID"]
27415 pub target_system: u8,
27416 #[doc = "Component ID"]
27417 pub target_component: u8,
27418 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27419 pub coordinate_frame: MavFrame,
27420}
27421impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27422 pub const ENCODED_LEN: usize = 53usize;
27423 pub const DEFAULT: Self = Self {
27424 time_boot_ms: 0_u32,
27425 x: 0.0_f32,
27426 y: 0.0_f32,
27427 z: 0.0_f32,
27428 vx: 0.0_f32,
27429 vy: 0.0_f32,
27430 vz: 0.0_f32,
27431 afx: 0.0_f32,
27432 afy: 0.0_f32,
27433 afz: 0.0_f32,
27434 yaw: 0.0_f32,
27435 yaw_rate: 0.0_f32,
27436 type_mask: PositionTargetTypemask::DEFAULT,
27437 target_system: 0_u8,
27438 target_component: 0_u8,
27439 coordinate_frame: MavFrame::DEFAULT,
27440 };
27441 #[cfg(feature = "arbitrary")]
27442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27443 use arbitrary::{Arbitrary, Unstructured};
27444 let mut buf = [0u8; 1024];
27445 rng.fill_bytes(&mut buf);
27446 let mut unstructured = Unstructured::new(&buf);
27447 Self::arbitrary(&mut unstructured).unwrap_or_default()
27448 }
27449}
27450impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27451 fn default() -> Self {
27452 Self::DEFAULT.clone()
27453 }
27454}
27455impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27456 type Message = MavMessage;
27457 const ID: u32 = 84u32;
27458 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27459 const EXTRA_CRC: u8 = 143u8;
27460 const ENCODED_LEN: usize = 53usize;
27461 fn deser(
27462 _version: MavlinkVersion,
27463 __input: &[u8],
27464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27465 let avail_len = __input.len();
27466 let mut payload_buf = [0; Self::ENCODED_LEN];
27467 let mut buf = if avail_len < Self::ENCODED_LEN {
27468 payload_buf[0..avail_len].copy_from_slice(__input);
27469 Bytes::new(&payload_buf)
27470 } else {
27471 Bytes::new(__input)
27472 };
27473 let mut __struct = Self::default();
27474 __struct.time_boot_ms = buf.get_u32_le();
27475 __struct.x = buf.get_f32_le();
27476 __struct.y = buf.get_f32_le();
27477 __struct.z = buf.get_f32_le();
27478 __struct.vx = buf.get_f32_le();
27479 __struct.vy = buf.get_f32_le();
27480 __struct.vz = buf.get_f32_le();
27481 __struct.afx = buf.get_f32_le();
27482 __struct.afy = buf.get_f32_le();
27483 __struct.afz = buf.get_f32_le();
27484 __struct.yaw = buf.get_f32_le();
27485 __struct.yaw_rate = buf.get_f32_le();
27486 let tmp = buf.get_u16_le();
27487 __struct.type_mask = PositionTargetTypemask::from_bits(
27488 tmp & PositionTargetTypemask::all().bits(),
27489 )
27490 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27491 flag_type: "PositionTargetTypemask",
27492 value: tmp as u32,
27493 })?;
27494 __struct.target_system = buf.get_u8();
27495 __struct.target_component = buf.get_u8();
27496 let tmp = buf.get_u8();
27497 __struct.coordinate_frame =
27498 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27499 enum_type: "MavFrame",
27500 value: tmp as u32,
27501 })?;
27502 Ok(__struct)
27503 }
27504 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27505 let mut __tmp = BytesMut::new(bytes);
27506 #[allow(clippy::absurd_extreme_comparisons)]
27507 #[allow(unused_comparisons)]
27508 if __tmp.remaining() < Self::ENCODED_LEN {
27509 panic!(
27510 "buffer is too small (need {} bytes, but got {})",
27511 Self::ENCODED_LEN,
27512 __tmp.remaining(),
27513 )
27514 }
27515 __tmp.put_u32_le(self.time_boot_ms);
27516 __tmp.put_f32_le(self.x);
27517 __tmp.put_f32_le(self.y);
27518 __tmp.put_f32_le(self.z);
27519 __tmp.put_f32_le(self.vx);
27520 __tmp.put_f32_le(self.vy);
27521 __tmp.put_f32_le(self.vz);
27522 __tmp.put_f32_le(self.afx);
27523 __tmp.put_f32_le(self.afy);
27524 __tmp.put_f32_le(self.afz);
27525 __tmp.put_f32_le(self.yaw);
27526 __tmp.put_f32_le(self.yaw_rate);
27527 __tmp.put_u16_le(self.type_mask.bits());
27528 __tmp.put_u8(self.target_system);
27529 __tmp.put_u8(self.target_component);
27530 __tmp.put_u8(self.coordinate_frame as u8);
27531 if matches!(version, MavlinkVersion::V2) {
27532 let len = __tmp.len();
27533 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27534 } else {
27535 __tmp.len()
27536 }
27537 }
27538}
27539#[doc = "id: 108"]
27540#[doc = "Status of simulation environment, if used."]
27541#[derive(Debug, Clone, PartialEq)]
27542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27544pub struct SIM_STATE_DATA {
27545 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
27546 pub q1: f32,
27547 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
27548 pub q2: f32,
27549 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
27550 pub q3: f32,
27551 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
27552 pub q4: f32,
27553 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
27554 pub roll: f32,
27555 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
27556 pub pitch: f32,
27557 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
27558 pub yaw: f32,
27559 #[doc = "X acceleration"]
27560 pub xacc: f32,
27561 #[doc = "Y acceleration"]
27562 pub yacc: f32,
27563 #[doc = "Z acceleration"]
27564 pub zacc: f32,
27565 #[doc = "Angular speed around X axis"]
27566 pub xgyro: f32,
27567 #[doc = "Angular speed around Y axis"]
27568 pub ygyro: f32,
27569 #[doc = "Angular speed around Z axis"]
27570 pub zgyro: f32,
27571 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
27572 pub lat: f32,
27573 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
27574 pub lon: f32,
27575 #[doc = "Altitude"]
27576 pub alt: f32,
27577 #[doc = "Horizontal position standard deviation"]
27578 pub std_dev_horz: f32,
27579 #[doc = "Vertical position standard deviation"]
27580 pub std_dev_vert: f32,
27581 #[doc = "True velocity in north direction in earth-fixed NED frame"]
27582 pub vn: f32,
27583 #[doc = "True velocity in east direction in earth-fixed NED frame"]
27584 pub ve: f32,
27585 #[doc = "True velocity in down direction in earth-fixed NED frame"]
27586 pub vd: f32,
27587 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
27588 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27589 pub lat_int: i32,
27590 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
27591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27592 pub lon_int: i32,
27593}
27594impl SIM_STATE_DATA {
27595 pub const ENCODED_LEN: usize = 92usize;
27596 pub const DEFAULT: Self = Self {
27597 q1: 0.0_f32,
27598 q2: 0.0_f32,
27599 q3: 0.0_f32,
27600 q4: 0.0_f32,
27601 roll: 0.0_f32,
27602 pitch: 0.0_f32,
27603 yaw: 0.0_f32,
27604 xacc: 0.0_f32,
27605 yacc: 0.0_f32,
27606 zacc: 0.0_f32,
27607 xgyro: 0.0_f32,
27608 ygyro: 0.0_f32,
27609 zgyro: 0.0_f32,
27610 lat: 0.0_f32,
27611 lon: 0.0_f32,
27612 alt: 0.0_f32,
27613 std_dev_horz: 0.0_f32,
27614 std_dev_vert: 0.0_f32,
27615 vn: 0.0_f32,
27616 ve: 0.0_f32,
27617 vd: 0.0_f32,
27618 lat_int: 0_i32,
27619 lon_int: 0_i32,
27620 };
27621 #[cfg(feature = "arbitrary")]
27622 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27623 use arbitrary::{Arbitrary, Unstructured};
27624 let mut buf = [0u8; 1024];
27625 rng.fill_bytes(&mut buf);
27626 let mut unstructured = Unstructured::new(&buf);
27627 Self::arbitrary(&mut unstructured).unwrap_or_default()
27628 }
27629}
27630impl Default for SIM_STATE_DATA {
27631 fn default() -> Self {
27632 Self::DEFAULT.clone()
27633 }
27634}
27635impl MessageData for SIM_STATE_DATA {
27636 type Message = MavMessage;
27637 const ID: u32 = 108u32;
27638 const NAME: &'static str = "SIM_STATE";
27639 const EXTRA_CRC: u8 = 32u8;
27640 const ENCODED_LEN: usize = 92usize;
27641 fn deser(
27642 _version: MavlinkVersion,
27643 __input: &[u8],
27644 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27645 let avail_len = __input.len();
27646 let mut payload_buf = [0; Self::ENCODED_LEN];
27647 let mut buf = if avail_len < Self::ENCODED_LEN {
27648 payload_buf[0..avail_len].copy_from_slice(__input);
27649 Bytes::new(&payload_buf)
27650 } else {
27651 Bytes::new(__input)
27652 };
27653 let mut __struct = Self::default();
27654 __struct.q1 = buf.get_f32_le();
27655 __struct.q2 = buf.get_f32_le();
27656 __struct.q3 = buf.get_f32_le();
27657 __struct.q4 = buf.get_f32_le();
27658 __struct.roll = buf.get_f32_le();
27659 __struct.pitch = buf.get_f32_le();
27660 __struct.yaw = buf.get_f32_le();
27661 __struct.xacc = buf.get_f32_le();
27662 __struct.yacc = buf.get_f32_le();
27663 __struct.zacc = buf.get_f32_le();
27664 __struct.xgyro = buf.get_f32_le();
27665 __struct.ygyro = buf.get_f32_le();
27666 __struct.zgyro = buf.get_f32_le();
27667 __struct.lat = buf.get_f32_le();
27668 __struct.lon = buf.get_f32_le();
27669 __struct.alt = buf.get_f32_le();
27670 __struct.std_dev_horz = buf.get_f32_le();
27671 __struct.std_dev_vert = buf.get_f32_le();
27672 __struct.vn = buf.get_f32_le();
27673 __struct.ve = buf.get_f32_le();
27674 __struct.vd = buf.get_f32_le();
27675 __struct.lat_int = buf.get_i32_le();
27676 __struct.lon_int = buf.get_i32_le();
27677 Ok(__struct)
27678 }
27679 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27680 let mut __tmp = BytesMut::new(bytes);
27681 #[allow(clippy::absurd_extreme_comparisons)]
27682 #[allow(unused_comparisons)]
27683 if __tmp.remaining() < Self::ENCODED_LEN {
27684 panic!(
27685 "buffer is too small (need {} bytes, but got {})",
27686 Self::ENCODED_LEN,
27687 __tmp.remaining(),
27688 )
27689 }
27690 __tmp.put_f32_le(self.q1);
27691 __tmp.put_f32_le(self.q2);
27692 __tmp.put_f32_le(self.q3);
27693 __tmp.put_f32_le(self.q4);
27694 __tmp.put_f32_le(self.roll);
27695 __tmp.put_f32_le(self.pitch);
27696 __tmp.put_f32_le(self.yaw);
27697 __tmp.put_f32_le(self.xacc);
27698 __tmp.put_f32_le(self.yacc);
27699 __tmp.put_f32_le(self.zacc);
27700 __tmp.put_f32_le(self.xgyro);
27701 __tmp.put_f32_le(self.ygyro);
27702 __tmp.put_f32_le(self.zgyro);
27703 __tmp.put_f32_le(self.lat);
27704 __tmp.put_f32_le(self.lon);
27705 __tmp.put_f32_le(self.alt);
27706 __tmp.put_f32_le(self.std_dev_horz);
27707 __tmp.put_f32_le(self.std_dev_vert);
27708 __tmp.put_f32_le(self.vn);
27709 __tmp.put_f32_le(self.ve);
27710 __tmp.put_f32_le(self.vd);
27711 __tmp.put_i32_le(self.lat_int);
27712 __tmp.put_i32_le(self.lon_int);
27713 if matches!(version, MavlinkVersion::V2) {
27714 let len = __tmp.len();
27715 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27716 } else {
27717 __tmp.len()
27718 }
27719 }
27720}
27721#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
27722#[doc = "id: 370"]
27723#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
27724#[derive(Debug, Clone, PartialEq)]
27725#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27726#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27727pub struct SMART_BATTERY_INFO_DATA {
27728 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
27729 pub capacity_full_specification: i32,
27730 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
27731 pub capacity_full: i32,
27732 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
27733 pub cycle_count: u16,
27734 #[doc = "Battery weight. 0: field not provided."]
27735 pub weight: u16,
27736 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
27737 pub discharge_minimum_voltage: u16,
27738 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
27739 pub charging_minimum_voltage: u16,
27740 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
27741 pub resting_minimum_voltage: u16,
27742 #[doc = "Battery ID"]
27743 pub id: u8,
27744 #[doc = "Function of the battery"]
27745 pub battery_function: MavBatteryFunction,
27746 #[doc = "Type (chemistry) of the battery"]
27747 pub mavtype: MavBatteryType,
27748 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
27749 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27750 pub serial_number: [u8; 16],
27751 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
27752 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27753 pub device_name: [u8; 50],
27754 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
27755 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27756 pub charging_maximum_voltage: u16,
27757 #[doc = "Number of battery cells in series. 0: field not provided."]
27758 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27759 pub cells_in_series: u8,
27760 #[doc = "Maximum pack discharge current. 0: field not provided."]
27761 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27762 pub discharge_maximum_current: u32,
27763 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
27764 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27765 pub discharge_maximum_burst_current: u32,
27766 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
27767 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27768 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27769 pub manufacture_date: [u8; 11],
27770}
27771impl SMART_BATTERY_INFO_DATA {
27772 pub const ENCODED_LEN: usize = 109usize;
27773 pub const DEFAULT: Self = Self {
27774 capacity_full_specification: 0_i32,
27775 capacity_full: 0_i32,
27776 cycle_count: 0_u16,
27777 weight: 0_u16,
27778 discharge_minimum_voltage: 0_u16,
27779 charging_minimum_voltage: 0_u16,
27780 resting_minimum_voltage: 0_u16,
27781 id: 0_u8,
27782 battery_function: MavBatteryFunction::DEFAULT,
27783 mavtype: MavBatteryType::DEFAULT,
27784 serial_number: [0_u8; 16usize],
27785 device_name: [0_u8; 50usize],
27786 charging_maximum_voltage: 0_u16,
27787 cells_in_series: 0_u8,
27788 discharge_maximum_current: 0_u32,
27789 discharge_maximum_burst_current: 0_u32,
27790 manufacture_date: [0_u8; 11usize],
27791 };
27792 #[cfg(feature = "arbitrary")]
27793 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27794 use arbitrary::{Arbitrary, Unstructured};
27795 let mut buf = [0u8; 1024];
27796 rng.fill_bytes(&mut buf);
27797 let mut unstructured = Unstructured::new(&buf);
27798 Self::arbitrary(&mut unstructured).unwrap_or_default()
27799 }
27800}
27801impl Default for SMART_BATTERY_INFO_DATA {
27802 fn default() -> Self {
27803 Self::DEFAULT.clone()
27804 }
27805}
27806impl MessageData for SMART_BATTERY_INFO_DATA {
27807 type Message = MavMessage;
27808 const ID: u32 = 370u32;
27809 const NAME: &'static str = "SMART_BATTERY_INFO";
27810 const EXTRA_CRC: u8 = 75u8;
27811 const ENCODED_LEN: usize = 109usize;
27812 fn deser(
27813 _version: MavlinkVersion,
27814 __input: &[u8],
27815 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27816 let avail_len = __input.len();
27817 let mut payload_buf = [0; Self::ENCODED_LEN];
27818 let mut buf = if avail_len < Self::ENCODED_LEN {
27819 payload_buf[0..avail_len].copy_from_slice(__input);
27820 Bytes::new(&payload_buf)
27821 } else {
27822 Bytes::new(__input)
27823 };
27824 let mut __struct = Self::default();
27825 __struct.capacity_full_specification = buf.get_i32_le();
27826 __struct.capacity_full = buf.get_i32_le();
27827 __struct.cycle_count = buf.get_u16_le();
27828 __struct.weight = buf.get_u16_le();
27829 __struct.discharge_minimum_voltage = buf.get_u16_le();
27830 __struct.charging_minimum_voltage = buf.get_u16_le();
27831 __struct.resting_minimum_voltage = buf.get_u16_le();
27832 __struct.id = buf.get_u8();
27833 let tmp = buf.get_u8();
27834 __struct.battery_function =
27835 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27836 enum_type: "MavBatteryFunction",
27837 value: tmp as u32,
27838 })?;
27839 let tmp = buf.get_u8();
27840 __struct.mavtype =
27841 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27842 enum_type: "MavBatteryType",
27843 value: tmp as u32,
27844 })?;
27845 for v in &mut __struct.serial_number {
27846 let val = buf.get_u8();
27847 *v = val;
27848 }
27849 for v in &mut __struct.device_name {
27850 let val = buf.get_u8();
27851 *v = val;
27852 }
27853 __struct.charging_maximum_voltage = buf.get_u16_le();
27854 __struct.cells_in_series = buf.get_u8();
27855 __struct.discharge_maximum_current = buf.get_u32_le();
27856 __struct.discharge_maximum_burst_current = buf.get_u32_le();
27857 for v in &mut __struct.manufacture_date {
27858 let val = buf.get_u8();
27859 *v = val;
27860 }
27861 Ok(__struct)
27862 }
27863 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27864 let mut __tmp = BytesMut::new(bytes);
27865 #[allow(clippy::absurd_extreme_comparisons)]
27866 #[allow(unused_comparisons)]
27867 if __tmp.remaining() < Self::ENCODED_LEN {
27868 panic!(
27869 "buffer is too small (need {} bytes, but got {})",
27870 Self::ENCODED_LEN,
27871 __tmp.remaining(),
27872 )
27873 }
27874 __tmp.put_i32_le(self.capacity_full_specification);
27875 __tmp.put_i32_le(self.capacity_full);
27876 __tmp.put_u16_le(self.cycle_count);
27877 __tmp.put_u16_le(self.weight);
27878 __tmp.put_u16_le(self.discharge_minimum_voltage);
27879 __tmp.put_u16_le(self.charging_minimum_voltage);
27880 __tmp.put_u16_le(self.resting_minimum_voltage);
27881 __tmp.put_u8(self.id);
27882 __tmp.put_u8(self.battery_function as u8);
27883 __tmp.put_u8(self.mavtype as u8);
27884 for val in &self.serial_number {
27885 __tmp.put_u8(*val);
27886 }
27887 for val in &self.device_name {
27888 __tmp.put_u8(*val);
27889 }
27890 __tmp.put_u16_le(self.charging_maximum_voltage);
27891 __tmp.put_u8(self.cells_in_series);
27892 __tmp.put_u32_le(self.discharge_maximum_current);
27893 __tmp.put_u32_le(self.discharge_maximum_burst_current);
27894 for val in &self.manufacture_date {
27895 __tmp.put_u8(*val);
27896 }
27897 if matches!(version, MavlinkVersion::V2) {
27898 let len = __tmp.len();
27899 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27900 } else {
27901 __tmp.len()
27902 }
27903 }
27904}
27905#[doc = "id: 253"]
27906#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
27907#[derive(Debug, Clone, PartialEq)]
27908#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27909#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27910pub struct STATUSTEXT_DATA {
27911 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
27912 pub severity: MavSeverity,
27913 #[doc = "Status text message, without null termination character"]
27914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27915 pub text: [u8; 50],
27916 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
27917 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27918 pub id: u16,
27919 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
27920 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27921 pub chunk_seq: u8,
27922}
27923impl STATUSTEXT_DATA {
27924 pub const ENCODED_LEN: usize = 54usize;
27925 pub const DEFAULT: Self = Self {
27926 severity: MavSeverity::DEFAULT,
27927 text: [0_u8; 50usize],
27928 id: 0_u16,
27929 chunk_seq: 0_u8,
27930 };
27931 #[cfg(feature = "arbitrary")]
27932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27933 use arbitrary::{Arbitrary, Unstructured};
27934 let mut buf = [0u8; 1024];
27935 rng.fill_bytes(&mut buf);
27936 let mut unstructured = Unstructured::new(&buf);
27937 Self::arbitrary(&mut unstructured).unwrap_or_default()
27938 }
27939}
27940impl Default for STATUSTEXT_DATA {
27941 fn default() -> Self {
27942 Self::DEFAULT.clone()
27943 }
27944}
27945impl MessageData for STATUSTEXT_DATA {
27946 type Message = MavMessage;
27947 const ID: u32 = 253u32;
27948 const NAME: &'static str = "STATUSTEXT";
27949 const EXTRA_CRC: u8 = 83u8;
27950 const ENCODED_LEN: usize = 54usize;
27951 fn deser(
27952 _version: MavlinkVersion,
27953 __input: &[u8],
27954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27955 let avail_len = __input.len();
27956 let mut payload_buf = [0; Self::ENCODED_LEN];
27957 let mut buf = if avail_len < Self::ENCODED_LEN {
27958 payload_buf[0..avail_len].copy_from_slice(__input);
27959 Bytes::new(&payload_buf)
27960 } else {
27961 Bytes::new(__input)
27962 };
27963 let mut __struct = Self::default();
27964 let tmp = buf.get_u8();
27965 __struct.severity =
27966 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27967 enum_type: "MavSeverity",
27968 value: tmp as u32,
27969 })?;
27970 for v in &mut __struct.text {
27971 let val = buf.get_u8();
27972 *v = val;
27973 }
27974 __struct.id = buf.get_u16_le();
27975 __struct.chunk_seq = buf.get_u8();
27976 Ok(__struct)
27977 }
27978 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27979 let mut __tmp = BytesMut::new(bytes);
27980 #[allow(clippy::absurd_extreme_comparisons)]
27981 #[allow(unused_comparisons)]
27982 if __tmp.remaining() < Self::ENCODED_LEN {
27983 panic!(
27984 "buffer is too small (need {} bytes, but got {})",
27985 Self::ENCODED_LEN,
27986 __tmp.remaining(),
27987 )
27988 }
27989 __tmp.put_u8(self.severity as u8);
27990 for val in &self.text {
27991 __tmp.put_u8(*val);
27992 }
27993 __tmp.put_u16_le(self.id);
27994 __tmp.put_u8(self.chunk_seq);
27995 if matches!(version, MavlinkVersion::V2) {
27996 let len = __tmp.len();
27997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27998 } else {
27999 __tmp.len()
28000 }
28001 }
28002}
28003#[doc = "id: 261"]
28004#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28005#[derive(Debug, Clone, PartialEq)]
28006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28008pub struct STORAGE_INFORMATION_DATA {
28009 #[doc = "Timestamp (time since system boot)."]
28010 pub time_boot_ms: u32,
28011 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28012 pub total_capacity: f32,
28013 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28014 pub used_capacity: f32,
28015 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28016 pub available_capacity: f32,
28017 #[doc = "Read speed."]
28018 pub read_speed: f32,
28019 #[doc = "Write speed."]
28020 pub write_speed: f32,
28021 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28022 pub storage_id: u8,
28023 #[doc = "Number of storage devices"]
28024 pub storage_count: u8,
28025 #[doc = "Status of storage"]
28026 pub status: StorageStatus,
28027 #[doc = "Type of storage"]
28028 #[cfg_attr(feature = "serde", serde(default))]
28029 pub mavtype: StorageType,
28030 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28031 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28032 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28033 pub name: [u8; 32],
28034 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28035 #[cfg_attr(feature = "serde", serde(default))]
28036 pub storage_usage: StorageUsageFlag,
28037}
28038impl STORAGE_INFORMATION_DATA {
28039 pub const ENCODED_LEN: usize = 61usize;
28040 pub const DEFAULT: Self = Self {
28041 time_boot_ms: 0_u32,
28042 total_capacity: 0.0_f32,
28043 used_capacity: 0.0_f32,
28044 available_capacity: 0.0_f32,
28045 read_speed: 0.0_f32,
28046 write_speed: 0.0_f32,
28047 storage_id: 0_u8,
28048 storage_count: 0_u8,
28049 status: StorageStatus::DEFAULT,
28050 mavtype: StorageType::DEFAULT,
28051 name: [0_u8; 32usize],
28052 storage_usage: StorageUsageFlag::DEFAULT,
28053 };
28054 #[cfg(feature = "arbitrary")]
28055 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28056 use arbitrary::{Arbitrary, Unstructured};
28057 let mut buf = [0u8; 1024];
28058 rng.fill_bytes(&mut buf);
28059 let mut unstructured = Unstructured::new(&buf);
28060 Self::arbitrary(&mut unstructured).unwrap_or_default()
28061 }
28062}
28063impl Default for STORAGE_INFORMATION_DATA {
28064 fn default() -> Self {
28065 Self::DEFAULT.clone()
28066 }
28067}
28068impl MessageData for STORAGE_INFORMATION_DATA {
28069 type Message = MavMessage;
28070 const ID: u32 = 261u32;
28071 const NAME: &'static str = "STORAGE_INFORMATION";
28072 const EXTRA_CRC: u8 = 179u8;
28073 const ENCODED_LEN: usize = 61usize;
28074 fn deser(
28075 _version: MavlinkVersion,
28076 __input: &[u8],
28077 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28078 let avail_len = __input.len();
28079 let mut payload_buf = [0; Self::ENCODED_LEN];
28080 let mut buf = if avail_len < Self::ENCODED_LEN {
28081 payload_buf[0..avail_len].copy_from_slice(__input);
28082 Bytes::new(&payload_buf)
28083 } else {
28084 Bytes::new(__input)
28085 };
28086 let mut __struct = Self::default();
28087 __struct.time_boot_ms = buf.get_u32_le();
28088 __struct.total_capacity = buf.get_f32_le();
28089 __struct.used_capacity = buf.get_f32_le();
28090 __struct.available_capacity = buf.get_f32_le();
28091 __struct.read_speed = buf.get_f32_le();
28092 __struct.write_speed = buf.get_f32_le();
28093 __struct.storage_id = buf.get_u8();
28094 __struct.storage_count = buf.get_u8();
28095 let tmp = buf.get_u8();
28096 __struct.status =
28097 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28098 enum_type: "StorageStatus",
28099 value: tmp as u32,
28100 })?;
28101 let tmp = buf.get_u8();
28102 __struct.mavtype =
28103 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28104 enum_type: "StorageType",
28105 value: tmp as u32,
28106 })?;
28107 for v in &mut __struct.name {
28108 let val = buf.get_u8();
28109 *v = val;
28110 }
28111 let tmp = buf.get_u8();
28112 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28113 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28114 flag_type: "StorageUsageFlag",
28115 value: tmp as u32,
28116 })?;
28117 Ok(__struct)
28118 }
28119 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28120 let mut __tmp = BytesMut::new(bytes);
28121 #[allow(clippy::absurd_extreme_comparisons)]
28122 #[allow(unused_comparisons)]
28123 if __tmp.remaining() < Self::ENCODED_LEN {
28124 panic!(
28125 "buffer is too small (need {} bytes, but got {})",
28126 Self::ENCODED_LEN,
28127 __tmp.remaining(),
28128 )
28129 }
28130 __tmp.put_u32_le(self.time_boot_ms);
28131 __tmp.put_f32_le(self.total_capacity);
28132 __tmp.put_f32_le(self.used_capacity);
28133 __tmp.put_f32_le(self.available_capacity);
28134 __tmp.put_f32_le(self.read_speed);
28135 __tmp.put_f32_le(self.write_speed);
28136 __tmp.put_u8(self.storage_id);
28137 __tmp.put_u8(self.storage_count);
28138 __tmp.put_u8(self.status as u8);
28139 __tmp.put_u8(self.mavtype as u8);
28140 for val in &self.name {
28141 __tmp.put_u8(*val);
28142 }
28143 __tmp.put_u8(self.storage_usage.bits());
28144 if matches!(version, MavlinkVersion::V2) {
28145 let len = __tmp.len();
28146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28147 } else {
28148 __tmp.len()
28149 }
28150 }
28151}
28152#[doc = "id: 401"]
28153#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28154#[derive(Debug, Clone, PartialEq)]
28155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28157pub struct SUPPORTED_TUNES_DATA {
28158 #[doc = "Bitfield of supported tune formats."]
28159 pub format: TuneFormat,
28160 #[doc = "System ID"]
28161 pub target_system: u8,
28162 #[doc = "Component ID"]
28163 pub target_component: u8,
28164}
28165impl SUPPORTED_TUNES_DATA {
28166 pub const ENCODED_LEN: usize = 6usize;
28167 pub const DEFAULT: Self = Self {
28168 format: TuneFormat::DEFAULT,
28169 target_system: 0_u8,
28170 target_component: 0_u8,
28171 };
28172 #[cfg(feature = "arbitrary")]
28173 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28174 use arbitrary::{Arbitrary, Unstructured};
28175 let mut buf = [0u8; 1024];
28176 rng.fill_bytes(&mut buf);
28177 let mut unstructured = Unstructured::new(&buf);
28178 Self::arbitrary(&mut unstructured).unwrap_or_default()
28179 }
28180}
28181impl Default for SUPPORTED_TUNES_DATA {
28182 fn default() -> Self {
28183 Self::DEFAULT.clone()
28184 }
28185}
28186impl MessageData for SUPPORTED_TUNES_DATA {
28187 type Message = MavMessage;
28188 const ID: u32 = 401u32;
28189 const NAME: &'static str = "SUPPORTED_TUNES";
28190 const EXTRA_CRC: u8 = 183u8;
28191 const ENCODED_LEN: usize = 6usize;
28192 fn deser(
28193 _version: MavlinkVersion,
28194 __input: &[u8],
28195 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28196 let avail_len = __input.len();
28197 let mut payload_buf = [0; Self::ENCODED_LEN];
28198 let mut buf = if avail_len < Self::ENCODED_LEN {
28199 payload_buf[0..avail_len].copy_from_slice(__input);
28200 Bytes::new(&payload_buf)
28201 } else {
28202 Bytes::new(__input)
28203 };
28204 let mut __struct = Self::default();
28205 let tmp = buf.get_u32_le();
28206 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28207 ::mavlink_core::error::ParserError::InvalidEnum {
28208 enum_type: "TuneFormat",
28209 value: tmp as u32,
28210 },
28211 )?;
28212 __struct.target_system = buf.get_u8();
28213 __struct.target_component = buf.get_u8();
28214 Ok(__struct)
28215 }
28216 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28217 let mut __tmp = BytesMut::new(bytes);
28218 #[allow(clippy::absurd_extreme_comparisons)]
28219 #[allow(unused_comparisons)]
28220 if __tmp.remaining() < Self::ENCODED_LEN {
28221 panic!(
28222 "buffer is too small (need {} bytes, but got {})",
28223 Self::ENCODED_LEN,
28224 __tmp.remaining(),
28225 )
28226 }
28227 __tmp.put_u32_le(self.format as u32);
28228 __tmp.put_u8(self.target_system);
28229 __tmp.put_u8(self.target_component);
28230 if matches!(version, MavlinkVersion::V2) {
28231 let len = __tmp.len();
28232 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28233 } else {
28234 __tmp.len()
28235 }
28236 }
28237}
28238#[doc = "id: 2"]
28239#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28240#[derive(Debug, Clone, PartialEq)]
28241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28242#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28243pub struct SYSTEM_TIME_DATA {
28244 #[doc = "Timestamp (UNIX epoch time)."]
28245 pub time_unix_usec: u64,
28246 #[doc = "Timestamp (time since system boot)."]
28247 pub time_boot_ms: u32,
28248}
28249impl SYSTEM_TIME_DATA {
28250 pub const ENCODED_LEN: usize = 12usize;
28251 pub const DEFAULT: Self = Self {
28252 time_unix_usec: 0_u64,
28253 time_boot_ms: 0_u32,
28254 };
28255 #[cfg(feature = "arbitrary")]
28256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28257 use arbitrary::{Arbitrary, Unstructured};
28258 let mut buf = [0u8; 1024];
28259 rng.fill_bytes(&mut buf);
28260 let mut unstructured = Unstructured::new(&buf);
28261 Self::arbitrary(&mut unstructured).unwrap_or_default()
28262 }
28263}
28264impl Default for SYSTEM_TIME_DATA {
28265 fn default() -> Self {
28266 Self::DEFAULT.clone()
28267 }
28268}
28269impl MessageData for SYSTEM_TIME_DATA {
28270 type Message = MavMessage;
28271 const ID: u32 = 2u32;
28272 const NAME: &'static str = "SYSTEM_TIME";
28273 const EXTRA_CRC: u8 = 137u8;
28274 const ENCODED_LEN: usize = 12usize;
28275 fn deser(
28276 _version: MavlinkVersion,
28277 __input: &[u8],
28278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28279 let avail_len = __input.len();
28280 let mut payload_buf = [0; Self::ENCODED_LEN];
28281 let mut buf = if avail_len < Self::ENCODED_LEN {
28282 payload_buf[0..avail_len].copy_from_slice(__input);
28283 Bytes::new(&payload_buf)
28284 } else {
28285 Bytes::new(__input)
28286 };
28287 let mut __struct = Self::default();
28288 __struct.time_unix_usec = buf.get_u64_le();
28289 __struct.time_boot_ms = buf.get_u32_le();
28290 Ok(__struct)
28291 }
28292 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28293 let mut __tmp = BytesMut::new(bytes);
28294 #[allow(clippy::absurd_extreme_comparisons)]
28295 #[allow(unused_comparisons)]
28296 if __tmp.remaining() < Self::ENCODED_LEN {
28297 panic!(
28298 "buffer is too small (need {} bytes, but got {})",
28299 Self::ENCODED_LEN,
28300 __tmp.remaining(),
28301 )
28302 }
28303 __tmp.put_u64_le(self.time_unix_usec);
28304 __tmp.put_u32_le(self.time_boot_ms);
28305 if matches!(version, MavlinkVersion::V2) {
28306 let len = __tmp.len();
28307 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28308 } else {
28309 __tmp.len()
28310 }
28311 }
28312}
28313#[doc = "id: 1"]
28314#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28315#[derive(Debug, Clone, PartialEq)]
28316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28318pub struct SYS_STATUS_DATA {
28319 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28320 pub onboard_control_sensors_present: MavSysStatusSensor,
28321 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28322 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28323 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28324 pub onboard_control_sensors_health: MavSysStatusSensor,
28325 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28326 pub load: u16,
28327 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28328 pub voltage_battery: u16,
28329 #[doc = "Battery current, -1: Current not sent by autopilot"]
28330 pub current_battery: i16,
28331 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28332 pub drop_rate_comm: u16,
28333 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28334 pub errors_comm: u16,
28335 #[doc = "Autopilot-specific errors"]
28336 pub errors_count1: u16,
28337 #[doc = "Autopilot-specific errors"]
28338 pub errors_count2: u16,
28339 #[doc = "Autopilot-specific errors"]
28340 pub errors_count3: u16,
28341 #[doc = "Autopilot-specific errors"]
28342 pub errors_count4: u16,
28343 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28344 pub battery_remaining: i8,
28345 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28346 #[cfg_attr(feature = "serde", serde(default))]
28347 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28348 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28349 #[cfg_attr(feature = "serde", serde(default))]
28350 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28351 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28352 #[cfg_attr(feature = "serde", serde(default))]
28353 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28354}
28355impl SYS_STATUS_DATA {
28356 pub const ENCODED_LEN: usize = 43usize;
28357 pub const DEFAULT: Self = Self {
28358 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28359 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28360 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28361 load: 0_u16,
28362 voltage_battery: 0_u16,
28363 current_battery: 0_i16,
28364 drop_rate_comm: 0_u16,
28365 errors_comm: 0_u16,
28366 errors_count1: 0_u16,
28367 errors_count2: 0_u16,
28368 errors_count3: 0_u16,
28369 errors_count4: 0_u16,
28370 battery_remaining: 0_i8,
28371 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28372 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28373 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28374 };
28375 #[cfg(feature = "arbitrary")]
28376 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28377 use arbitrary::{Arbitrary, Unstructured};
28378 let mut buf = [0u8; 1024];
28379 rng.fill_bytes(&mut buf);
28380 let mut unstructured = Unstructured::new(&buf);
28381 Self::arbitrary(&mut unstructured).unwrap_or_default()
28382 }
28383}
28384impl Default for SYS_STATUS_DATA {
28385 fn default() -> Self {
28386 Self::DEFAULT.clone()
28387 }
28388}
28389impl MessageData for SYS_STATUS_DATA {
28390 type Message = MavMessage;
28391 const ID: u32 = 1u32;
28392 const NAME: &'static str = "SYS_STATUS";
28393 const EXTRA_CRC: u8 = 124u8;
28394 const ENCODED_LEN: usize = 43usize;
28395 fn deser(
28396 _version: MavlinkVersion,
28397 __input: &[u8],
28398 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28399 let avail_len = __input.len();
28400 let mut payload_buf = [0; Self::ENCODED_LEN];
28401 let mut buf = if avail_len < Self::ENCODED_LEN {
28402 payload_buf[0..avail_len].copy_from_slice(__input);
28403 Bytes::new(&payload_buf)
28404 } else {
28405 Bytes::new(__input)
28406 };
28407 let mut __struct = Self::default();
28408 let tmp = buf.get_u32_le();
28409 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28410 tmp & MavSysStatusSensor::all().bits(),
28411 )
28412 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28413 flag_type: "MavSysStatusSensor",
28414 value: tmp as u32,
28415 })?;
28416 let tmp = buf.get_u32_le();
28417 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28418 tmp & MavSysStatusSensor::all().bits(),
28419 )
28420 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28421 flag_type: "MavSysStatusSensor",
28422 value: tmp as u32,
28423 })?;
28424 let tmp = buf.get_u32_le();
28425 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28426 tmp & MavSysStatusSensor::all().bits(),
28427 )
28428 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28429 flag_type: "MavSysStatusSensor",
28430 value: tmp as u32,
28431 })?;
28432 __struct.load = buf.get_u16_le();
28433 __struct.voltage_battery = buf.get_u16_le();
28434 __struct.current_battery = buf.get_i16_le();
28435 __struct.drop_rate_comm = buf.get_u16_le();
28436 __struct.errors_comm = buf.get_u16_le();
28437 __struct.errors_count1 = buf.get_u16_le();
28438 __struct.errors_count2 = buf.get_u16_le();
28439 __struct.errors_count3 = buf.get_u16_le();
28440 __struct.errors_count4 = buf.get_u16_le();
28441 __struct.battery_remaining = buf.get_i8();
28442 let tmp = buf.get_u32_le();
28443 __struct.onboard_control_sensors_present_extended =
28444 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28445 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28446 flag_type: "MavSysStatusSensorExtended",
28447 value: tmp as u32,
28448 })?;
28449 let tmp = buf.get_u32_le();
28450 __struct.onboard_control_sensors_enabled_extended =
28451 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28452 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28453 flag_type: "MavSysStatusSensorExtended",
28454 value: tmp as u32,
28455 })?;
28456 let tmp = buf.get_u32_le();
28457 __struct.onboard_control_sensors_health_extended =
28458 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28459 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28460 flag_type: "MavSysStatusSensorExtended",
28461 value: tmp as u32,
28462 })?;
28463 Ok(__struct)
28464 }
28465 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28466 let mut __tmp = BytesMut::new(bytes);
28467 #[allow(clippy::absurd_extreme_comparisons)]
28468 #[allow(unused_comparisons)]
28469 if __tmp.remaining() < Self::ENCODED_LEN {
28470 panic!(
28471 "buffer is too small (need {} bytes, but got {})",
28472 Self::ENCODED_LEN,
28473 __tmp.remaining(),
28474 )
28475 }
28476 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28477 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28478 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28479 __tmp.put_u16_le(self.load);
28480 __tmp.put_u16_le(self.voltage_battery);
28481 __tmp.put_i16_le(self.current_battery);
28482 __tmp.put_u16_le(self.drop_rate_comm);
28483 __tmp.put_u16_le(self.errors_comm);
28484 __tmp.put_u16_le(self.errors_count1);
28485 __tmp.put_u16_le(self.errors_count2);
28486 __tmp.put_u16_le(self.errors_count3);
28487 __tmp.put_u16_le(self.errors_count4);
28488 __tmp.put_i8(self.battery_remaining);
28489 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28490 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28491 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28492 if matches!(version, MavlinkVersion::V2) {
28493 let len = __tmp.len();
28494 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28495 } else {
28496 __tmp.len()
28497 }
28498 }
28499}
28500#[doc = "id: 135"]
28501#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28502#[derive(Debug, Clone, PartialEq)]
28503#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28504#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28505pub struct TERRAIN_CHECK_DATA {
28506 #[doc = "Latitude"]
28507 pub lat: i32,
28508 #[doc = "Longitude"]
28509 pub lon: i32,
28510}
28511impl TERRAIN_CHECK_DATA {
28512 pub const ENCODED_LEN: usize = 8usize;
28513 pub const DEFAULT: Self = Self {
28514 lat: 0_i32,
28515 lon: 0_i32,
28516 };
28517 #[cfg(feature = "arbitrary")]
28518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28519 use arbitrary::{Arbitrary, Unstructured};
28520 let mut buf = [0u8; 1024];
28521 rng.fill_bytes(&mut buf);
28522 let mut unstructured = Unstructured::new(&buf);
28523 Self::arbitrary(&mut unstructured).unwrap_or_default()
28524 }
28525}
28526impl Default for TERRAIN_CHECK_DATA {
28527 fn default() -> Self {
28528 Self::DEFAULT.clone()
28529 }
28530}
28531impl MessageData for TERRAIN_CHECK_DATA {
28532 type Message = MavMessage;
28533 const ID: u32 = 135u32;
28534 const NAME: &'static str = "TERRAIN_CHECK";
28535 const EXTRA_CRC: u8 = 203u8;
28536 const ENCODED_LEN: usize = 8usize;
28537 fn deser(
28538 _version: MavlinkVersion,
28539 __input: &[u8],
28540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28541 let avail_len = __input.len();
28542 let mut payload_buf = [0; Self::ENCODED_LEN];
28543 let mut buf = if avail_len < Self::ENCODED_LEN {
28544 payload_buf[0..avail_len].copy_from_slice(__input);
28545 Bytes::new(&payload_buf)
28546 } else {
28547 Bytes::new(__input)
28548 };
28549 let mut __struct = Self::default();
28550 __struct.lat = buf.get_i32_le();
28551 __struct.lon = buf.get_i32_le();
28552 Ok(__struct)
28553 }
28554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28555 let mut __tmp = BytesMut::new(bytes);
28556 #[allow(clippy::absurd_extreme_comparisons)]
28557 #[allow(unused_comparisons)]
28558 if __tmp.remaining() < Self::ENCODED_LEN {
28559 panic!(
28560 "buffer is too small (need {} bytes, but got {})",
28561 Self::ENCODED_LEN,
28562 __tmp.remaining(),
28563 )
28564 }
28565 __tmp.put_i32_le(self.lat);
28566 __tmp.put_i32_le(self.lon);
28567 if matches!(version, MavlinkVersion::V2) {
28568 let len = __tmp.len();
28569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28570 } else {
28571 __tmp.len()
28572 }
28573 }
28574}
28575#[doc = "id: 134"]
28576#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28577#[derive(Debug, Clone, PartialEq)]
28578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28579#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28580pub struct TERRAIN_DATA_DATA {
28581 #[doc = "Latitude of SW corner of first grid"]
28582 pub lat: i32,
28583 #[doc = "Longitude of SW corner of first grid"]
28584 pub lon: i32,
28585 #[doc = "Grid spacing"]
28586 pub grid_spacing: u16,
28587 #[doc = "Terrain data MSL"]
28588 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28589 pub data: [i16; 16],
28590 #[doc = "bit within the terrain request mask"]
28591 pub gridbit: u8,
28592}
28593impl TERRAIN_DATA_DATA {
28594 pub const ENCODED_LEN: usize = 43usize;
28595 pub const DEFAULT: Self = Self {
28596 lat: 0_i32,
28597 lon: 0_i32,
28598 grid_spacing: 0_u16,
28599 data: [0_i16; 16usize],
28600 gridbit: 0_u8,
28601 };
28602 #[cfg(feature = "arbitrary")]
28603 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28604 use arbitrary::{Arbitrary, Unstructured};
28605 let mut buf = [0u8; 1024];
28606 rng.fill_bytes(&mut buf);
28607 let mut unstructured = Unstructured::new(&buf);
28608 Self::arbitrary(&mut unstructured).unwrap_or_default()
28609 }
28610}
28611impl Default for TERRAIN_DATA_DATA {
28612 fn default() -> Self {
28613 Self::DEFAULT.clone()
28614 }
28615}
28616impl MessageData for TERRAIN_DATA_DATA {
28617 type Message = MavMessage;
28618 const ID: u32 = 134u32;
28619 const NAME: &'static str = "TERRAIN_DATA";
28620 const EXTRA_CRC: u8 = 229u8;
28621 const ENCODED_LEN: usize = 43usize;
28622 fn deser(
28623 _version: MavlinkVersion,
28624 __input: &[u8],
28625 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28626 let avail_len = __input.len();
28627 let mut payload_buf = [0; Self::ENCODED_LEN];
28628 let mut buf = if avail_len < Self::ENCODED_LEN {
28629 payload_buf[0..avail_len].copy_from_slice(__input);
28630 Bytes::new(&payload_buf)
28631 } else {
28632 Bytes::new(__input)
28633 };
28634 let mut __struct = Self::default();
28635 __struct.lat = buf.get_i32_le();
28636 __struct.lon = buf.get_i32_le();
28637 __struct.grid_spacing = buf.get_u16_le();
28638 for v in &mut __struct.data {
28639 let val = buf.get_i16_le();
28640 *v = val;
28641 }
28642 __struct.gridbit = buf.get_u8();
28643 Ok(__struct)
28644 }
28645 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28646 let mut __tmp = BytesMut::new(bytes);
28647 #[allow(clippy::absurd_extreme_comparisons)]
28648 #[allow(unused_comparisons)]
28649 if __tmp.remaining() < Self::ENCODED_LEN {
28650 panic!(
28651 "buffer is too small (need {} bytes, but got {})",
28652 Self::ENCODED_LEN,
28653 __tmp.remaining(),
28654 )
28655 }
28656 __tmp.put_i32_le(self.lat);
28657 __tmp.put_i32_le(self.lon);
28658 __tmp.put_u16_le(self.grid_spacing);
28659 for val in &self.data {
28660 __tmp.put_i16_le(*val);
28661 }
28662 __tmp.put_u8(self.gridbit);
28663 if matches!(version, MavlinkVersion::V2) {
28664 let len = __tmp.len();
28665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28666 } else {
28667 __tmp.len()
28668 }
28669 }
28670}
28671#[doc = "id: 136"]
28672#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28673#[derive(Debug, Clone, PartialEq)]
28674#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28675#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28676pub struct TERRAIN_REPORT_DATA {
28677 #[doc = "Latitude"]
28678 pub lat: i32,
28679 #[doc = "Longitude"]
28680 pub lon: i32,
28681 #[doc = "Terrain height MSL"]
28682 pub terrain_height: f32,
28683 #[doc = "Current vehicle height above lat/lon terrain height"]
28684 pub current_height: f32,
28685 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
28686 pub spacing: u16,
28687 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
28688 pub pending: u16,
28689 #[doc = "Number of 4x4 terrain blocks in memory"]
28690 pub loaded: u16,
28691}
28692impl TERRAIN_REPORT_DATA {
28693 pub const ENCODED_LEN: usize = 22usize;
28694 pub const DEFAULT: Self = Self {
28695 lat: 0_i32,
28696 lon: 0_i32,
28697 terrain_height: 0.0_f32,
28698 current_height: 0.0_f32,
28699 spacing: 0_u16,
28700 pending: 0_u16,
28701 loaded: 0_u16,
28702 };
28703 #[cfg(feature = "arbitrary")]
28704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28705 use arbitrary::{Arbitrary, Unstructured};
28706 let mut buf = [0u8; 1024];
28707 rng.fill_bytes(&mut buf);
28708 let mut unstructured = Unstructured::new(&buf);
28709 Self::arbitrary(&mut unstructured).unwrap_or_default()
28710 }
28711}
28712impl Default for TERRAIN_REPORT_DATA {
28713 fn default() -> Self {
28714 Self::DEFAULT.clone()
28715 }
28716}
28717impl MessageData for TERRAIN_REPORT_DATA {
28718 type Message = MavMessage;
28719 const ID: u32 = 136u32;
28720 const NAME: &'static str = "TERRAIN_REPORT";
28721 const EXTRA_CRC: u8 = 1u8;
28722 const ENCODED_LEN: usize = 22usize;
28723 fn deser(
28724 _version: MavlinkVersion,
28725 __input: &[u8],
28726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28727 let avail_len = __input.len();
28728 let mut payload_buf = [0; Self::ENCODED_LEN];
28729 let mut buf = if avail_len < Self::ENCODED_LEN {
28730 payload_buf[0..avail_len].copy_from_slice(__input);
28731 Bytes::new(&payload_buf)
28732 } else {
28733 Bytes::new(__input)
28734 };
28735 let mut __struct = Self::default();
28736 __struct.lat = buf.get_i32_le();
28737 __struct.lon = buf.get_i32_le();
28738 __struct.terrain_height = buf.get_f32_le();
28739 __struct.current_height = buf.get_f32_le();
28740 __struct.spacing = buf.get_u16_le();
28741 __struct.pending = buf.get_u16_le();
28742 __struct.loaded = buf.get_u16_le();
28743 Ok(__struct)
28744 }
28745 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28746 let mut __tmp = BytesMut::new(bytes);
28747 #[allow(clippy::absurd_extreme_comparisons)]
28748 #[allow(unused_comparisons)]
28749 if __tmp.remaining() < Self::ENCODED_LEN {
28750 panic!(
28751 "buffer is too small (need {} bytes, but got {})",
28752 Self::ENCODED_LEN,
28753 __tmp.remaining(),
28754 )
28755 }
28756 __tmp.put_i32_le(self.lat);
28757 __tmp.put_i32_le(self.lon);
28758 __tmp.put_f32_le(self.terrain_height);
28759 __tmp.put_f32_le(self.current_height);
28760 __tmp.put_u16_le(self.spacing);
28761 __tmp.put_u16_le(self.pending);
28762 __tmp.put_u16_le(self.loaded);
28763 if matches!(version, MavlinkVersion::V2) {
28764 let len = __tmp.len();
28765 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28766 } else {
28767 __tmp.len()
28768 }
28769 }
28770}
28771#[doc = "id: 133"]
28772#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
28773#[derive(Debug, Clone, PartialEq)]
28774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28776pub struct TERRAIN_REQUEST_DATA {
28777 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
28778 pub mask: u64,
28779 #[doc = "Latitude of SW corner of first grid"]
28780 pub lat: i32,
28781 #[doc = "Longitude of SW corner of first grid"]
28782 pub lon: i32,
28783 #[doc = "Grid spacing"]
28784 pub grid_spacing: u16,
28785}
28786impl TERRAIN_REQUEST_DATA {
28787 pub const ENCODED_LEN: usize = 18usize;
28788 pub const DEFAULT: Self = Self {
28789 mask: 0_u64,
28790 lat: 0_i32,
28791 lon: 0_i32,
28792 grid_spacing: 0_u16,
28793 };
28794 #[cfg(feature = "arbitrary")]
28795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28796 use arbitrary::{Arbitrary, Unstructured};
28797 let mut buf = [0u8; 1024];
28798 rng.fill_bytes(&mut buf);
28799 let mut unstructured = Unstructured::new(&buf);
28800 Self::arbitrary(&mut unstructured).unwrap_or_default()
28801 }
28802}
28803impl Default for TERRAIN_REQUEST_DATA {
28804 fn default() -> Self {
28805 Self::DEFAULT.clone()
28806 }
28807}
28808impl MessageData for TERRAIN_REQUEST_DATA {
28809 type Message = MavMessage;
28810 const ID: u32 = 133u32;
28811 const NAME: &'static str = "TERRAIN_REQUEST";
28812 const EXTRA_CRC: u8 = 6u8;
28813 const ENCODED_LEN: usize = 18usize;
28814 fn deser(
28815 _version: MavlinkVersion,
28816 __input: &[u8],
28817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28818 let avail_len = __input.len();
28819 let mut payload_buf = [0; Self::ENCODED_LEN];
28820 let mut buf = if avail_len < Self::ENCODED_LEN {
28821 payload_buf[0..avail_len].copy_from_slice(__input);
28822 Bytes::new(&payload_buf)
28823 } else {
28824 Bytes::new(__input)
28825 };
28826 let mut __struct = Self::default();
28827 __struct.mask = buf.get_u64_le();
28828 __struct.lat = buf.get_i32_le();
28829 __struct.lon = buf.get_i32_le();
28830 __struct.grid_spacing = buf.get_u16_le();
28831 Ok(__struct)
28832 }
28833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28834 let mut __tmp = BytesMut::new(bytes);
28835 #[allow(clippy::absurd_extreme_comparisons)]
28836 #[allow(unused_comparisons)]
28837 if __tmp.remaining() < Self::ENCODED_LEN {
28838 panic!(
28839 "buffer is too small (need {} bytes, but got {})",
28840 Self::ENCODED_LEN,
28841 __tmp.remaining(),
28842 )
28843 }
28844 __tmp.put_u64_le(self.mask);
28845 __tmp.put_i32_le(self.lat);
28846 __tmp.put_i32_le(self.lon);
28847 __tmp.put_u16_le(self.grid_spacing);
28848 if matches!(version, MavlinkVersion::V2) {
28849 let len = __tmp.len();
28850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28851 } else {
28852 __tmp.len()
28853 }
28854 }
28855}
28856#[doc = "id: 111"]
28857#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
28858#[derive(Debug, Clone, PartialEq)]
28859#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28860#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28861pub struct TIMESYNC_DATA {
28862 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
28863 pub tc1: i64,
28864 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
28865 pub ts1: i64,
28866 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
28867 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28868 pub target_system: u8,
28869 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
28870 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28871 pub target_component: u8,
28872}
28873impl TIMESYNC_DATA {
28874 pub const ENCODED_LEN: usize = 18usize;
28875 pub const DEFAULT: Self = Self {
28876 tc1: 0_i64,
28877 ts1: 0_i64,
28878 target_system: 0_u8,
28879 target_component: 0_u8,
28880 };
28881 #[cfg(feature = "arbitrary")]
28882 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28883 use arbitrary::{Arbitrary, Unstructured};
28884 let mut buf = [0u8; 1024];
28885 rng.fill_bytes(&mut buf);
28886 let mut unstructured = Unstructured::new(&buf);
28887 Self::arbitrary(&mut unstructured).unwrap_or_default()
28888 }
28889}
28890impl Default for TIMESYNC_DATA {
28891 fn default() -> Self {
28892 Self::DEFAULT.clone()
28893 }
28894}
28895impl MessageData for TIMESYNC_DATA {
28896 type Message = MavMessage;
28897 const ID: u32 = 111u32;
28898 const NAME: &'static str = "TIMESYNC";
28899 const EXTRA_CRC: u8 = 34u8;
28900 const ENCODED_LEN: usize = 18usize;
28901 fn deser(
28902 _version: MavlinkVersion,
28903 __input: &[u8],
28904 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28905 let avail_len = __input.len();
28906 let mut payload_buf = [0; Self::ENCODED_LEN];
28907 let mut buf = if avail_len < Self::ENCODED_LEN {
28908 payload_buf[0..avail_len].copy_from_slice(__input);
28909 Bytes::new(&payload_buf)
28910 } else {
28911 Bytes::new(__input)
28912 };
28913 let mut __struct = Self::default();
28914 __struct.tc1 = buf.get_i64_le();
28915 __struct.ts1 = buf.get_i64_le();
28916 __struct.target_system = buf.get_u8();
28917 __struct.target_component = buf.get_u8();
28918 Ok(__struct)
28919 }
28920 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28921 let mut __tmp = BytesMut::new(bytes);
28922 #[allow(clippy::absurd_extreme_comparisons)]
28923 #[allow(unused_comparisons)]
28924 if __tmp.remaining() < Self::ENCODED_LEN {
28925 panic!(
28926 "buffer is too small (need {} bytes, but got {})",
28927 Self::ENCODED_LEN,
28928 __tmp.remaining(),
28929 )
28930 }
28931 __tmp.put_i64_le(self.tc1);
28932 __tmp.put_i64_le(self.ts1);
28933 __tmp.put_u8(self.target_system);
28934 __tmp.put_u8(self.target_component);
28935 if matches!(version, MavlinkVersion::V2) {
28936 let len = __tmp.len();
28937 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28938 } else {
28939 __tmp.len()
28940 }
28941 }
28942}
28943#[doc = "id: 380"]
28944#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
28945#[derive(Debug, Clone, PartialEq)]
28946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28948pub struct TIME_ESTIMATE_TO_TARGET_DATA {
28949 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
28950 pub safe_return: i32,
28951 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
28952 pub land: i32,
28953 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
28954 pub mission_next_item: i32,
28955 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
28956 pub mission_end: i32,
28957 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
28958 pub commanded_action: i32,
28959}
28960impl TIME_ESTIMATE_TO_TARGET_DATA {
28961 pub const ENCODED_LEN: usize = 20usize;
28962 pub const DEFAULT: Self = Self {
28963 safe_return: 0_i32,
28964 land: 0_i32,
28965 mission_next_item: 0_i32,
28966 mission_end: 0_i32,
28967 commanded_action: 0_i32,
28968 };
28969 #[cfg(feature = "arbitrary")]
28970 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28971 use arbitrary::{Arbitrary, Unstructured};
28972 let mut buf = [0u8; 1024];
28973 rng.fill_bytes(&mut buf);
28974 let mut unstructured = Unstructured::new(&buf);
28975 Self::arbitrary(&mut unstructured).unwrap_or_default()
28976 }
28977}
28978impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
28979 fn default() -> Self {
28980 Self::DEFAULT.clone()
28981 }
28982}
28983impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
28984 type Message = MavMessage;
28985 const ID: u32 = 380u32;
28986 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
28987 const EXTRA_CRC: u8 = 232u8;
28988 const ENCODED_LEN: usize = 20usize;
28989 fn deser(
28990 _version: MavlinkVersion,
28991 __input: &[u8],
28992 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28993 let avail_len = __input.len();
28994 let mut payload_buf = [0; Self::ENCODED_LEN];
28995 let mut buf = if avail_len < Self::ENCODED_LEN {
28996 payload_buf[0..avail_len].copy_from_slice(__input);
28997 Bytes::new(&payload_buf)
28998 } else {
28999 Bytes::new(__input)
29000 };
29001 let mut __struct = Self::default();
29002 __struct.safe_return = buf.get_i32_le();
29003 __struct.land = buf.get_i32_le();
29004 __struct.mission_next_item = buf.get_i32_le();
29005 __struct.mission_end = buf.get_i32_le();
29006 __struct.commanded_action = buf.get_i32_le();
29007 Ok(__struct)
29008 }
29009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29010 let mut __tmp = BytesMut::new(bytes);
29011 #[allow(clippy::absurd_extreme_comparisons)]
29012 #[allow(unused_comparisons)]
29013 if __tmp.remaining() < Self::ENCODED_LEN {
29014 panic!(
29015 "buffer is too small (need {} bytes, but got {})",
29016 Self::ENCODED_LEN,
29017 __tmp.remaining(),
29018 )
29019 }
29020 __tmp.put_i32_le(self.safe_return);
29021 __tmp.put_i32_le(self.land);
29022 __tmp.put_i32_le(self.mission_next_item);
29023 __tmp.put_i32_le(self.mission_end);
29024 __tmp.put_i32_le(self.commanded_action);
29025 if matches!(version, MavlinkVersion::V2) {
29026 let len = __tmp.len();
29027 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29028 } else {
29029 __tmp.len()
29030 }
29031 }
29032}
29033#[doc = "id: 333"]
29034#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29035#[derive(Debug, Clone, PartialEq)]
29036#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29037#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29038pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29039 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29040 pub time_usec: u64,
29041 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29042 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29043 pub pos_x: [f32; 5],
29044 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29045 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29046 pub pos_y: [f32; 5],
29047 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29048 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29049 pub pos_z: [f32; 5],
29050 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29051 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29052 pub delta: [f32; 5],
29053 #[doc = "Yaw. Set to NaN for unchanged"]
29054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29055 pub pos_yaw: [f32; 5],
29056 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29057 pub valid_points: u8,
29058}
29059impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29060 pub const ENCODED_LEN: usize = 109usize;
29061 pub const DEFAULT: Self = Self {
29062 time_usec: 0_u64,
29063 pos_x: [0.0_f32; 5usize],
29064 pos_y: [0.0_f32; 5usize],
29065 pos_z: [0.0_f32; 5usize],
29066 delta: [0.0_f32; 5usize],
29067 pos_yaw: [0.0_f32; 5usize],
29068 valid_points: 0_u8,
29069 };
29070 #[cfg(feature = "arbitrary")]
29071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29072 use arbitrary::{Arbitrary, Unstructured};
29073 let mut buf = [0u8; 1024];
29074 rng.fill_bytes(&mut buf);
29075 let mut unstructured = Unstructured::new(&buf);
29076 Self::arbitrary(&mut unstructured).unwrap_or_default()
29077 }
29078}
29079impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29080 fn default() -> Self {
29081 Self::DEFAULT.clone()
29082 }
29083}
29084impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29085 type Message = MavMessage;
29086 const ID: u32 = 333u32;
29087 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29088 const EXTRA_CRC: u8 = 231u8;
29089 const ENCODED_LEN: usize = 109usize;
29090 fn deser(
29091 _version: MavlinkVersion,
29092 __input: &[u8],
29093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29094 let avail_len = __input.len();
29095 let mut payload_buf = [0; Self::ENCODED_LEN];
29096 let mut buf = if avail_len < Self::ENCODED_LEN {
29097 payload_buf[0..avail_len].copy_from_slice(__input);
29098 Bytes::new(&payload_buf)
29099 } else {
29100 Bytes::new(__input)
29101 };
29102 let mut __struct = Self::default();
29103 __struct.time_usec = buf.get_u64_le();
29104 for v in &mut __struct.pos_x {
29105 let val = buf.get_f32_le();
29106 *v = val;
29107 }
29108 for v in &mut __struct.pos_y {
29109 let val = buf.get_f32_le();
29110 *v = val;
29111 }
29112 for v in &mut __struct.pos_z {
29113 let val = buf.get_f32_le();
29114 *v = val;
29115 }
29116 for v in &mut __struct.delta {
29117 let val = buf.get_f32_le();
29118 *v = val;
29119 }
29120 for v in &mut __struct.pos_yaw {
29121 let val = buf.get_f32_le();
29122 *v = val;
29123 }
29124 __struct.valid_points = buf.get_u8();
29125 Ok(__struct)
29126 }
29127 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29128 let mut __tmp = BytesMut::new(bytes);
29129 #[allow(clippy::absurd_extreme_comparisons)]
29130 #[allow(unused_comparisons)]
29131 if __tmp.remaining() < Self::ENCODED_LEN {
29132 panic!(
29133 "buffer is too small (need {} bytes, but got {})",
29134 Self::ENCODED_LEN,
29135 __tmp.remaining(),
29136 )
29137 }
29138 __tmp.put_u64_le(self.time_usec);
29139 for val in &self.pos_x {
29140 __tmp.put_f32_le(*val);
29141 }
29142 for val in &self.pos_y {
29143 __tmp.put_f32_le(*val);
29144 }
29145 for val in &self.pos_z {
29146 __tmp.put_f32_le(*val);
29147 }
29148 for val in &self.delta {
29149 __tmp.put_f32_le(*val);
29150 }
29151 for val in &self.pos_yaw {
29152 __tmp.put_f32_le(*val);
29153 }
29154 __tmp.put_u8(self.valid_points);
29155 if matches!(version, MavlinkVersion::V2) {
29156 let len = __tmp.len();
29157 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29158 } else {
29159 __tmp.len()
29160 }
29161 }
29162}
29163#[doc = "id: 332"]
29164#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29165#[derive(Debug, Clone, PartialEq)]
29166#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29168pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29169 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29170 pub time_usec: u64,
29171 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29173 pub pos_x: [f32; 5],
29174 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29175 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29176 pub pos_y: [f32; 5],
29177 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29178 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29179 pub pos_z: [f32; 5],
29180 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29181 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29182 pub vel_x: [f32; 5],
29183 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29184 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29185 pub vel_y: [f32; 5],
29186 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29187 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29188 pub vel_z: [f32; 5],
29189 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29190 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29191 pub acc_x: [f32; 5],
29192 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29193 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29194 pub acc_y: [f32; 5],
29195 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29197 pub acc_z: [f32; 5],
29198 #[doc = "Yaw angle, set to NaN if not being used"]
29199 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29200 pub pos_yaw: [f32; 5],
29201 #[doc = "Yaw rate, set to NaN if not being used"]
29202 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29203 pub vel_yaw: [f32; 5],
29204 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29205 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29206 pub command: [u16; 5],
29207 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29208 pub valid_points: u8,
29209}
29210impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29211 pub const ENCODED_LEN: usize = 239usize;
29212 pub const DEFAULT: Self = Self {
29213 time_usec: 0_u64,
29214 pos_x: [0.0_f32; 5usize],
29215 pos_y: [0.0_f32; 5usize],
29216 pos_z: [0.0_f32; 5usize],
29217 vel_x: [0.0_f32; 5usize],
29218 vel_y: [0.0_f32; 5usize],
29219 vel_z: [0.0_f32; 5usize],
29220 acc_x: [0.0_f32; 5usize],
29221 acc_y: [0.0_f32; 5usize],
29222 acc_z: [0.0_f32; 5usize],
29223 pos_yaw: [0.0_f32; 5usize],
29224 vel_yaw: [0.0_f32; 5usize],
29225 command: [0_u16; 5usize],
29226 valid_points: 0_u8,
29227 };
29228 #[cfg(feature = "arbitrary")]
29229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29230 use arbitrary::{Arbitrary, Unstructured};
29231 let mut buf = [0u8; 1024];
29232 rng.fill_bytes(&mut buf);
29233 let mut unstructured = Unstructured::new(&buf);
29234 Self::arbitrary(&mut unstructured).unwrap_or_default()
29235 }
29236}
29237impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29238 fn default() -> Self {
29239 Self::DEFAULT.clone()
29240 }
29241}
29242impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29243 type Message = MavMessage;
29244 const ID: u32 = 332u32;
29245 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29246 const EXTRA_CRC: u8 = 236u8;
29247 const ENCODED_LEN: usize = 239usize;
29248 fn deser(
29249 _version: MavlinkVersion,
29250 __input: &[u8],
29251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29252 let avail_len = __input.len();
29253 let mut payload_buf = [0; Self::ENCODED_LEN];
29254 let mut buf = if avail_len < Self::ENCODED_LEN {
29255 payload_buf[0..avail_len].copy_from_slice(__input);
29256 Bytes::new(&payload_buf)
29257 } else {
29258 Bytes::new(__input)
29259 };
29260 let mut __struct = Self::default();
29261 __struct.time_usec = buf.get_u64_le();
29262 for v in &mut __struct.pos_x {
29263 let val = buf.get_f32_le();
29264 *v = val;
29265 }
29266 for v in &mut __struct.pos_y {
29267 let val = buf.get_f32_le();
29268 *v = val;
29269 }
29270 for v in &mut __struct.pos_z {
29271 let val = buf.get_f32_le();
29272 *v = val;
29273 }
29274 for v in &mut __struct.vel_x {
29275 let val = buf.get_f32_le();
29276 *v = val;
29277 }
29278 for v in &mut __struct.vel_y {
29279 let val = buf.get_f32_le();
29280 *v = val;
29281 }
29282 for v in &mut __struct.vel_z {
29283 let val = buf.get_f32_le();
29284 *v = val;
29285 }
29286 for v in &mut __struct.acc_x {
29287 let val = buf.get_f32_le();
29288 *v = val;
29289 }
29290 for v in &mut __struct.acc_y {
29291 let val = buf.get_f32_le();
29292 *v = val;
29293 }
29294 for v in &mut __struct.acc_z {
29295 let val = buf.get_f32_le();
29296 *v = val;
29297 }
29298 for v in &mut __struct.pos_yaw {
29299 let val = buf.get_f32_le();
29300 *v = val;
29301 }
29302 for v in &mut __struct.vel_yaw {
29303 let val = buf.get_f32_le();
29304 *v = val;
29305 }
29306 for v in &mut __struct.command {
29307 let val = buf.get_u16_le();
29308 *v = val;
29309 }
29310 __struct.valid_points = buf.get_u8();
29311 Ok(__struct)
29312 }
29313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29314 let mut __tmp = BytesMut::new(bytes);
29315 #[allow(clippy::absurd_extreme_comparisons)]
29316 #[allow(unused_comparisons)]
29317 if __tmp.remaining() < Self::ENCODED_LEN {
29318 panic!(
29319 "buffer is too small (need {} bytes, but got {})",
29320 Self::ENCODED_LEN,
29321 __tmp.remaining(),
29322 )
29323 }
29324 __tmp.put_u64_le(self.time_usec);
29325 for val in &self.pos_x {
29326 __tmp.put_f32_le(*val);
29327 }
29328 for val in &self.pos_y {
29329 __tmp.put_f32_le(*val);
29330 }
29331 for val in &self.pos_z {
29332 __tmp.put_f32_le(*val);
29333 }
29334 for val in &self.vel_x {
29335 __tmp.put_f32_le(*val);
29336 }
29337 for val in &self.vel_y {
29338 __tmp.put_f32_le(*val);
29339 }
29340 for val in &self.vel_z {
29341 __tmp.put_f32_le(*val);
29342 }
29343 for val in &self.acc_x {
29344 __tmp.put_f32_le(*val);
29345 }
29346 for val in &self.acc_y {
29347 __tmp.put_f32_le(*val);
29348 }
29349 for val in &self.acc_z {
29350 __tmp.put_f32_le(*val);
29351 }
29352 for val in &self.pos_yaw {
29353 __tmp.put_f32_le(*val);
29354 }
29355 for val in &self.vel_yaw {
29356 __tmp.put_f32_le(*val);
29357 }
29358 for val in &self.command {
29359 __tmp.put_u16_le(*val);
29360 }
29361 __tmp.put_u8(self.valid_points);
29362 if matches!(version, MavlinkVersion::V2) {
29363 let len = __tmp.len();
29364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29365 } else {
29366 __tmp.len()
29367 }
29368 }
29369}
29370#[doc = "id: 385"]
29371#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29372#[derive(Debug, Clone, PartialEq)]
29373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29375pub struct TUNNEL_DATA {
29376 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29377 pub payload_type: MavTunnelPayloadType,
29378 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29379 pub target_system: u8,
29380 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29381 pub target_component: u8,
29382 #[doc = "Length of the data transported in payload"]
29383 pub payload_length: u8,
29384 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29385 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29386 pub payload: [u8; 128],
29387}
29388impl TUNNEL_DATA {
29389 pub const ENCODED_LEN: usize = 133usize;
29390 pub const DEFAULT: Self = Self {
29391 payload_type: MavTunnelPayloadType::DEFAULT,
29392 target_system: 0_u8,
29393 target_component: 0_u8,
29394 payload_length: 0_u8,
29395 payload: [0_u8; 128usize],
29396 };
29397 #[cfg(feature = "arbitrary")]
29398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29399 use arbitrary::{Arbitrary, Unstructured};
29400 let mut buf = [0u8; 1024];
29401 rng.fill_bytes(&mut buf);
29402 let mut unstructured = Unstructured::new(&buf);
29403 Self::arbitrary(&mut unstructured).unwrap_or_default()
29404 }
29405}
29406impl Default for TUNNEL_DATA {
29407 fn default() -> Self {
29408 Self::DEFAULT.clone()
29409 }
29410}
29411impl MessageData for TUNNEL_DATA {
29412 type Message = MavMessage;
29413 const ID: u32 = 385u32;
29414 const NAME: &'static str = "TUNNEL";
29415 const EXTRA_CRC: u8 = 147u8;
29416 const ENCODED_LEN: usize = 133usize;
29417 fn deser(
29418 _version: MavlinkVersion,
29419 __input: &[u8],
29420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29421 let avail_len = __input.len();
29422 let mut payload_buf = [0; Self::ENCODED_LEN];
29423 let mut buf = if avail_len < Self::ENCODED_LEN {
29424 payload_buf[0..avail_len].copy_from_slice(__input);
29425 Bytes::new(&payload_buf)
29426 } else {
29427 Bytes::new(__input)
29428 };
29429 let mut __struct = Self::default();
29430 let tmp = buf.get_u16_le();
29431 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29432 ::mavlink_core::error::ParserError::InvalidEnum {
29433 enum_type: "MavTunnelPayloadType",
29434 value: tmp as u32,
29435 },
29436 )?;
29437 __struct.target_system = buf.get_u8();
29438 __struct.target_component = buf.get_u8();
29439 __struct.payload_length = buf.get_u8();
29440 for v in &mut __struct.payload {
29441 let val = buf.get_u8();
29442 *v = val;
29443 }
29444 Ok(__struct)
29445 }
29446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29447 let mut __tmp = BytesMut::new(bytes);
29448 #[allow(clippy::absurd_extreme_comparisons)]
29449 #[allow(unused_comparisons)]
29450 if __tmp.remaining() < Self::ENCODED_LEN {
29451 panic!(
29452 "buffer is too small (need {} bytes, but got {})",
29453 Self::ENCODED_LEN,
29454 __tmp.remaining(),
29455 )
29456 }
29457 __tmp.put_u16_le(self.payload_type as u16);
29458 __tmp.put_u8(self.target_system);
29459 __tmp.put_u8(self.target_component);
29460 __tmp.put_u8(self.payload_length);
29461 for val in &self.payload {
29462 __tmp.put_u8(*val);
29463 }
29464 if matches!(version, MavlinkVersion::V2) {
29465 let len = __tmp.len();
29466 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29467 } else {
29468 __tmp.len()
29469 }
29470 }
29471}
29472#[doc = "id: 311"]
29473#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29474#[derive(Debug, Clone, PartialEq)]
29475#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29477pub struct UAVCAN_NODE_INFO_DATA {
29478 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29479 pub time_usec: u64,
29480 #[doc = "Time since the start-up of the node."]
29481 pub uptime_sec: u32,
29482 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29483 pub sw_vcs_commit: u32,
29484 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29485 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29486 pub name: [u8; 80],
29487 #[doc = "Hardware major version number."]
29488 pub hw_version_major: u8,
29489 #[doc = "Hardware minor version number."]
29490 pub hw_version_minor: u8,
29491 #[doc = "Hardware unique 128-bit ID."]
29492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29493 pub hw_unique_id: [u8; 16],
29494 #[doc = "Software major version number."]
29495 pub sw_version_major: u8,
29496 #[doc = "Software minor version number."]
29497 pub sw_version_minor: u8,
29498}
29499impl UAVCAN_NODE_INFO_DATA {
29500 pub const ENCODED_LEN: usize = 116usize;
29501 pub const DEFAULT: Self = Self {
29502 time_usec: 0_u64,
29503 uptime_sec: 0_u32,
29504 sw_vcs_commit: 0_u32,
29505 name: [0_u8; 80usize],
29506 hw_version_major: 0_u8,
29507 hw_version_minor: 0_u8,
29508 hw_unique_id: [0_u8; 16usize],
29509 sw_version_major: 0_u8,
29510 sw_version_minor: 0_u8,
29511 };
29512 #[cfg(feature = "arbitrary")]
29513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29514 use arbitrary::{Arbitrary, Unstructured};
29515 let mut buf = [0u8; 1024];
29516 rng.fill_bytes(&mut buf);
29517 let mut unstructured = Unstructured::new(&buf);
29518 Self::arbitrary(&mut unstructured).unwrap_or_default()
29519 }
29520}
29521impl Default for UAVCAN_NODE_INFO_DATA {
29522 fn default() -> Self {
29523 Self::DEFAULT.clone()
29524 }
29525}
29526impl MessageData for UAVCAN_NODE_INFO_DATA {
29527 type Message = MavMessage;
29528 const ID: u32 = 311u32;
29529 const NAME: &'static str = "UAVCAN_NODE_INFO";
29530 const EXTRA_CRC: u8 = 95u8;
29531 const ENCODED_LEN: usize = 116usize;
29532 fn deser(
29533 _version: MavlinkVersion,
29534 __input: &[u8],
29535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29536 let avail_len = __input.len();
29537 let mut payload_buf = [0; Self::ENCODED_LEN];
29538 let mut buf = if avail_len < Self::ENCODED_LEN {
29539 payload_buf[0..avail_len].copy_from_slice(__input);
29540 Bytes::new(&payload_buf)
29541 } else {
29542 Bytes::new(__input)
29543 };
29544 let mut __struct = Self::default();
29545 __struct.time_usec = buf.get_u64_le();
29546 __struct.uptime_sec = buf.get_u32_le();
29547 __struct.sw_vcs_commit = buf.get_u32_le();
29548 for v in &mut __struct.name {
29549 let val = buf.get_u8();
29550 *v = val;
29551 }
29552 __struct.hw_version_major = buf.get_u8();
29553 __struct.hw_version_minor = buf.get_u8();
29554 for v in &mut __struct.hw_unique_id {
29555 let val = buf.get_u8();
29556 *v = val;
29557 }
29558 __struct.sw_version_major = buf.get_u8();
29559 __struct.sw_version_minor = buf.get_u8();
29560 Ok(__struct)
29561 }
29562 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29563 let mut __tmp = BytesMut::new(bytes);
29564 #[allow(clippy::absurd_extreme_comparisons)]
29565 #[allow(unused_comparisons)]
29566 if __tmp.remaining() < Self::ENCODED_LEN {
29567 panic!(
29568 "buffer is too small (need {} bytes, but got {})",
29569 Self::ENCODED_LEN,
29570 __tmp.remaining(),
29571 )
29572 }
29573 __tmp.put_u64_le(self.time_usec);
29574 __tmp.put_u32_le(self.uptime_sec);
29575 __tmp.put_u32_le(self.sw_vcs_commit);
29576 for val in &self.name {
29577 __tmp.put_u8(*val);
29578 }
29579 __tmp.put_u8(self.hw_version_major);
29580 __tmp.put_u8(self.hw_version_minor);
29581 for val in &self.hw_unique_id {
29582 __tmp.put_u8(*val);
29583 }
29584 __tmp.put_u8(self.sw_version_major);
29585 __tmp.put_u8(self.sw_version_minor);
29586 if matches!(version, MavlinkVersion::V2) {
29587 let len = __tmp.len();
29588 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29589 } else {
29590 __tmp.len()
29591 }
29592 }
29593}
29594#[doc = "id: 310"]
29595#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
29596#[derive(Debug, Clone, PartialEq)]
29597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29599pub struct UAVCAN_NODE_STATUS_DATA {
29600 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29601 pub time_usec: u64,
29602 #[doc = "Time since the start-up of the node."]
29603 pub uptime_sec: u32,
29604 #[doc = "Vendor-specific status information."]
29605 pub vendor_specific_status_code: u16,
29606 #[doc = "Generalized node health status."]
29607 pub health: UavcanNodeHealth,
29608 #[doc = "Generalized operating mode."]
29609 pub mode: UavcanNodeMode,
29610 #[doc = "Not used currently."]
29611 pub sub_mode: u8,
29612}
29613impl UAVCAN_NODE_STATUS_DATA {
29614 pub const ENCODED_LEN: usize = 17usize;
29615 pub const DEFAULT: Self = Self {
29616 time_usec: 0_u64,
29617 uptime_sec: 0_u32,
29618 vendor_specific_status_code: 0_u16,
29619 health: UavcanNodeHealth::DEFAULT,
29620 mode: UavcanNodeMode::DEFAULT,
29621 sub_mode: 0_u8,
29622 };
29623 #[cfg(feature = "arbitrary")]
29624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29625 use arbitrary::{Arbitrary, Unstructured};
29626 let mut buf = [0u8; 1024];
29627 rng.fill_bytes(&mut buf);
29628 let mut unstructured = Unstructured::new(&buf);
29629 Self::arbitrary(&mut unstructured).unwrap_or_default()
29630 }
29631}
29632impl Default for UAVCAN_NODE_STATUS_DATA {
29633 fn default() -> Self {
29634 Self::DEFAULT.clone()
29635 }
29636}
29637impl MessageData for UAVCAN_NODE_STATUS_DATA {
29638 type Message = MavMessage;
29639 const ID: u32 = 310u32;
29640 const NAME: &'static str = "UAVCAN_NODE_STATUS";
29641 const EXTRA_CRC: u8 = 28u8;
29642 const ENCODED_LEN: usize = 17usize;
29643 fn deser(
29644 _version: MavlinkVersion,
29645 __input: &[u8],
29646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29647 let avail_len = __input.len();
29648 let mut payload_buf = [0; Self::ENCODED_LEN];
29649 let mut buf = if avail_len < Self::ENCODED_LEN {
29650 payload_buf[0..avail_len].copy_from_slice(__input);
29651 Bytes::new(&payload_buf)
29652 } else {
29653 Bytes::new(__input)
29654 };
29655 let mut __struct = Self::default();
29656 __struct.time_usec = buf.get_u64_le();
29657 __struct.uptime_sec = buf.get_u32_le();
29658 __struct.vendor_specific_status_code = buf.get_u16_le();
29659 let tmp = buf.get_u8();
29660 __struct.health =
29661 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29662 enum_type: "UavcanNodeHealth",
29663 value: tmp as u32,
29664 })?;
29665 let tmp = buf.get_u8();
29666 __struct.mode =
29667 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29668 enum_type: "UavcanNodeMode",
29669 value: tmp as u32,
29670 })?;
29671 __struct.sub_mode = buf.get_u8();
29672 Ok(__struct)
29673 }
29674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29675 let mut __tmp = BytesMut::new(bytes);
29676 #[allow(clippy::absurd_extreme_comparisons)]
29677 #[allow(unused_comparisons)]
29678 if __tmp.remaining() < Self::ENCODED_LEN {
29679 panic!(
29680 "buffer is too small (need {} bytes, but got {})",
29681 Self::ENCODED_LEN,
29682 __tmp.remaining(),
29683 )
29684 }
29685 __tmp.put_u64_le(self.time_usec);
29686 __tmp.put_u32_le(self.uptime_sec);
29687 __tmp.put_u16_le(self.vendor_specific_status_code);
29688 __tmp.put_u8(self.health as u8);
29689 __tmp.put_u8(self.mode as u8);
29690 __tmp.put_u8(self.sub_mode);
29691 if matches!(version, MavlinkVersion::V2) {
29692 let len = __tmp.len();
29693 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29694 } else {
29695 __tmp.len()
29696 }
29697 }
29698}
29699#[doc = "id: 10006"]
29700#[doc = "Request messages."]
29701#[derive(Debug, Clone, PartialEq)]
29702#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29703#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29704pub struct UAVIONIX_ADSB_GET_DATA {
29705 #[doc = "Message ID to request. Supports any message in this 10000-10099 range"]
29706 pub ReqMessageId: u32,
29707}
29708impl UAVIONIX_ADSB_GET_DATA {
29709 pub const ENCODED_LEN: usize = 4usize;
29710 pub const DEFAULT: Self = Self {
29711 ReqMessageId: 0_u32,
29712 };
29713 #[cfg(feature = "arbitrary")]
29714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29715 use arbitrary::{Arbitrary, Unstructured};
29716 let mut buf = [0u8; 1024];
29717 rng.fill_bytes(&mut buf);
29718 let mut unstructured = Unstructured::new(&buf);
29719 Self::arbitrary(&mut unstructured).unwrap_or_default()
29720 }
29721}
29722impl Default for UAVIONIX_ADSB_GET_DATA {
29723 fn default() -> Self {
29724 Self::DEFAULT.clone()
29725 }
29726}
29727impl MessageData for UAVIONIX_ADSB_GET_DATA {
29728 type Message = MavMessage;
29729 const ID: u32 = 10006u32;
29730 const NAME: &'static str = "UAVIONIX_ADSB_GET";
29731 const EXTRA_CRC: u8 = 193u8;
29732 const ENCODED_LEN: usize = 4usize;
29733 fn deser(
29734 _version: MavlinkVersion,
29735 __input: &[u8],
29736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29737 let avail_len = __input.len();
29738 let mut payload_buf = [0; Self::ENCODED_LEN];
29739 let mut buf = if avail_len < Self::ENCODED_LEN {
29740 payload_buf[0..avail_len].copy_from_slice(__input);
29741 Bytes::new(&payload_buf)
29742 } else {
29743 Bytes::new(__input)
29744 };
29745 let mut __struct = Self::default();
29746 __struct.ReqMessageId = buf.get_u32_le();
29747 Ok(__struct)
29748 }
29749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29750 let mut __tmp = BytesMut::new(bytes);
29751 #[allow(clippy::absurd_extreme_comparisons)]
29752 #[allow(unused_comparisons)]
29753 if __tmp.remaining() < Self::ENCODED_LEN {
29754 panic!(
29755 "buffer is too small (need {} bytes, but got {})",
29756 Self::ENCODED_LEN,
29757 __tmp.remaining(),
29758 )
29759 }
29760 __tmp.put_u32_le(self.ReqMessageId);
29761 if matches!(version, MavlinkVersion::V2) {
29762 let len = __tmp.len();
29763 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29764 } else {
29765 __tmp.len()
29766 }
29767 }
29768}
29769#[doc = "id: 10001"]
29770#[doc = "Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter)."]
29771#[derive(Debug, Clone, PartialEq)]
29772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29773#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29774pub struct UAVIONIX_ADSB_OUT_CFG_DATA {
29775 #[doc = "Vehicle address (24 bit)"]
29776 pub ICAO: u32,
29777 #[doc = "Aircraft stall speed in cm/s"]
29778 pub stallSpeed: u16,
29779 #[doc = "Vehicle identifier (8 characters, null terminated, valid characters are A-Z, 0-9, \" \" only)"]
29780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29781 pub callsign: [u8; 9],
29782 #[doc = "Transmitting vehicle type. See ADSB_EMITTER_TYPE enum"]
29783 pub emitterType: AdsbEmitterType,
29784 #[doc = "Aircraft length and width encoding (table 2-35 of DO-282B)"]
29785 pub aircraftSize: UavionixAdsbOutCfgAircraftSize,
29786 #[doc = "GPS antenna lateral offset (table 2-36 of DO-282B)"]
29787 pub gpsOffsetLat: UavionixAdsbOutCfgGpsOffsetLat,
29788 #[doc = "GPS antenna longitudinal offset from nose [if non-zero, take position (in meters) divide by 2 and add one] (table 2-37 DO-282B)"]
29789 pub gpsOffsetLon: UavionixAdsbOutCfgGpsOffsetLon,
29790 #[doc = "ADS-B transponder reciever and transmit enable flags"]
29791 pub rfSelect: UavionixAdsbOutRfSelect,
29792}
29793impl UAVIONIX_ADSB_OUT_CFG_DATA {
29794 pub const ENCODED_LEN: usize = 20usize;
29795 pub const DEFAULT: Self = Self {
29796 ICAO: 0_u32,
29797 stallSpeed: 0_u16,
29798 callsign: [0_u8; 9usize],
29799 emitterType: AdsbEmitterType::DEFAULT,
29800 aircraftSize: UavionixAdsbOutCfgAircraftSize::DEFAULT,
29801 gpsOffsetLat: UavionixAdsbOutCfgGpsOffsetLat::DEFAULT,
29802 gpsOffsetLon: UavionixAdsbOutCfgGpsOffsetLon::DEFAULT,
29803 rfSelect: UavionixAdsbOutRfSelect::DEFAULT,
29804 };
29805 #[cfg(feature = "arbitrary")]
29806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29807 use arbitrary::{Arbitrary, Unstructured};
29808 let mut buf = [0u8; 1024];
29809 rng.fill_bytes(&mut buf);
29810 let mut unstructured = Unstructured::new(&buf);
29811 Self::arbitrary(&mut unstructured).unwrap_or_default()
29812 }
29813}
29814impl Default for UAVIONIX_ADSB_OUT_CFG_DATA {
29815 fn default() -> Self {
29816 Self::DEFAULT.clone()
29817 }
29818}
29819impl MessageData for UAVIONIX_ADSB_OUT_CFG_DATA {
29820 type Message = MavMessage;
29821 const ID: u32 = 10001u32;
29822 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG";
29823 const EXTRA_CRC: u8 = 209u8;
29824 const ENCODED_LEN: usize = 20usize;
29825 fn deser(
29826 _version: MavlinkVersion,
29827 __input: &[u8],
29828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29829 let avail_len = __input.len();
29830 let mut payload_buf = [0; Self::ENCODED_LEN];
29831 let mut buf = if avail_len < Self::ENCODED_LEN {
29832 payload_buf[0..avail_len].copy_from_slice(__input);
29833 Bytes::new(&payload_buf)
29834 } else {
29835 Bytes::new(__input)
29836 };
29837 let mut __struct = Self::default();
29838 __struct.ICAO = buf.get_u32_le();
29839 __struct.stallSpeed = buf.get_u16_le();
29840 for v in &mut __struct.callsign {
29841 let val = buf.get_u8();
29842 *v = val;
29843 }
29844 let tmp = buf.get_u8();
29845 __struct.emitterType =
29846 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29847 enum_type: "AdsbEmitterType",
29848 value: tmp as u32,
29849 })?;
29850 let tmp = buf.get_u8();
29851 __struct.aircraftSize =
29852 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29853 enum_type: "UavionixAdsbOutCfgAircraftSize",
29854 value: tmp as u32,
29855 })?;
29856 let tmp = buf.get_u8();
29857 __struct.gpsOffsetLat =
29858 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29859 enum_type: "UavionixAdsbOutCfgGpsOffsetLat",
29860 value: tmp as u32,
29861 })?;
29862 let tmp = buf.get_u8();
29863 __struct.gpsOffsetLon =
29864 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29865 enum_type: "UavionixAdsbOutCfgGpsOffsetLon",
29866 value: tmp as u32,
29867 })?;
29868 let tmp = buf.get_u8();
29869 __struct.rfSelect = UavionixAdsbOutRfSelect::from_bits(
29870 tmp & UavionixAdsbOutRfSelect::all().bits(),
29871 )
29872 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29873 flag_type: "UavionixAdsbOutRfSelect",
29874 value: tmp as u32,
29875 })?;
29876 Ok(__struct)
29877 }
29878 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29879 let mut __tmp = BytesMut::new(bytes);
29880 #[allow(clippy::absurd_extreme_comparisons)]
29881 #[allow(unused_comparisons)]
29882 if __tmp.remaining() < Self::ENCODED_LEN {
29883 panic!(
29884 "buffer is too small (need {} bytes, but got {})",
29885 Self::ENCODED_LEN,
29886 __tmp.remaining(),
29887 )
29888 }
29889 __tmp.put_u32_le(self.ICAO);
29890 __tmp.put_u16_le(self.stallSpeed);
29891 for val in &self.callsign {
29892 __tmp.put_u8(*val);
29893 }
29894 __tmp.put_u8(self.emitterType as u8);
29895 __tmp.put_u8(self.aircraftSize as u8);
29896 __tmp.put_u8(self.gpsOffsetLat as u8);
29897 __tmp.put_u8(self.gpsOffsetLon as u8);
29898 __tmp.put_u8(self.rfSelect.bits());
29899 if matches!(version, MavlinkVersion::V2) {
29900 let len = __tmp.len();
29901 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29902 } else {
29903 __tmp.len()
29904 }
29905 }
29906}
29907#[doc = "id: 10005"]
29908#[doc = "Flight Identification for ADSB-Out vehicles."]
29909#[derive(Debug, Clone, PartialEq)]
29910#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29911#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29912pub struct UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
29913 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable. Reflects Control message setting. This is null-terminated."]
29914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29915 pub flight_id: [u8; 9],
29916}
29917impl UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
29918 pub const ENCODED_LEN: usize = 9usize;
29919 pub const DEFAULT: Self = Self {
29920 flight_id: [0_u8; 9usize],
29921 };
29922 #[cfg(feature = "arbitrary")]
29923 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29924 use arbitrary::{Arbitrary, Unstructured};
29925 let mut buf = [0u8; 1024];
29926 rng.fill_bytes(&mut buf);
29927 let mut unstructured = Unstructured::new(&buf);
29928 Self::arbitrary(&mut unstructured).unwrap_or_default()
29929 }
29930}
29931impl Default for UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
29932 fn default() -> Self {
29933 Self::DEFAULT.clone()
29934 }
29935}
29936impl MessageData for UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA {
29937 type Message = MavMessage;
29938 const ID: u32 = 10005u32;
29939 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG_FLIGHTID";
29940 const EXTRA_CRC: u8 = 103u8;
29941 const ENCODED_LEN: usize = 9usize;
29942 fn deser(
29943 _version: MavlinkVersion,
29944 __input: &[u8],
29945 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29946 let avail_len = __input.len();
29947 let mut payload_buf = [0; Self::ENCODED_LEN];
29948 let mut buf = if avail_len < Self::ENCODED_LEN {
29949 payload_buf[0..avail_len].copy_from_slice(__input);
29950 Bytes::new(&payload_buf)
29951 } else {
29952 Bytes::new(__input)
29953 };
29954 let mut __struct = Self::default();
29955 for v in &mut __struct.flight_id {
29956 let val = buf.get_u8();
29957 *v = val;
29958 }
29959 Ok(__struct)
29960 }
29961 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29962 let mut __tmp = BytesMut::new(bytes);
29963 #[allow(clippy::absurd_extreme_comparisons)]
29964 #[allow(unused_comparisons)]
29965 if __tmp.remaining() < Self::ENCODED_LEN {
29966 panic!(
29967 "buffer is too small (need {} bytes, but got {})",
29968 Self::ENCODED_LEN,
29969 __tmp.remaining(),
29970 )
29971 }
29972 for val in &self.flight_id {
29973 __tmp.put_u8(*val);
29974 }
29975 if matches!(version, MavlinkVersion::V2) {
29976 let len = __tmp.len();
29977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29978 } else {
29979 __tmp.len()
29980 }
29981 }
29982}
29983#[doc = "id: 10004"]
29984#[doc = "Aircraft Registration."]
29985#[derive(Debug, Clone, PartialEq)]
29986#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29987#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29988pub struct UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
29989 #[doc = "Aircraft Registration (ASCII string A-Z, 0-9 only), e.g. \"N8644B \". Trailing spaces (0x20) only. This is null-terminated."]
29990 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29991 pub registration: [u8; 9],
29992}
29993impl UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
29994 pub const ENCODED_LEN: usize = 9usize;
29995 pub const DEFAULT: Self = Self {
29996 registration: [0_u8; 9usize],
29997 };
29998 #[cfg(feature = "arbitrary")]
29999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30000 use arbitrary::{Arbitrary, Unstructured};
30001 let mut buf = [0u8; 1024];
30002 rng.fill_bytes(&mut buf);
30003 let mut unstructured = Unstructured::new(&buf);
30004 Self::arbitrary(&mut unstructured).unwrap_or_default()
30005 }
30006}
30007impl Default for UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
30008 fn default() -> Self {
30009 Self::DEFAULT.clone()
30010 }
30011}
30012impl MessageData for UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA {
30013 type Message = MavMessage;
30014 const ID: u32 = 10004u32;
30015 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CFG_REGISTRATION";
30016 const EXTRA_CRC: u8 = 133u8;
30017 const ENCODED_LEN: usize = 9usize;
30018 fn deser(
30019 _version: MavlinkVersion,
30020 __input: &[u8],
30021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30022 let avail_len = __input.len();
30023 let mut payload_buf = [0; Self::ENCODED_LEN];
30024 let mut buf = if avail_len < Self::ENCODED_LEN {
30025 payload_buf[0..avail_len].copy_from_slice(__input);
30026 Bytes::new(&payload_buf)
30027 } else {
30028 Bytes::new(__input)
30029 };
30030 let mut __struct = Self::default();
30031 for v in &mut __struct.registration {
30032 let val = buf.get_u8();
30033 *v = val;
30034 }
30035 Ok(__struct)
30036 }
30037 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30038 let mut __tmp = BytesMut::new(bytes);
30039 #[allow(clippy::absurd_extreme_comparisons)]
30040 #[allow(unused_comparisons)]
30041 if __tmp.remaining() < Self::ENCODED_LEN {
30042 panic!(
30043 "buffer is too small (need {} bytes, but got {})",
30044 Self::ENCODED_LEN,
30045 __tmp.remaining(),
30046 )
30047 }
30048 for val in &self.registration {
30049 __tmp.put_u8(*val);
30050 }
30051 if matches!(version, MavlinkVersion::V2) {
30052 let len = __tmp.len();
30053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30054 } else {
30055 __tmp.len()
30056 }
30057 }
30058}
30059#[doc = "id: 10007"]
30060#[doc = "Control message with all data sent in UCP control message."]
30061#[derive(Debug, Clone, PartialEq)]
30062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30064pub struct UAVIONIX_ADSB_OUT_CONTROL_DATA {
30065 #[doc = "Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX"]
30066 pub baroAltMSL: i32,
30067 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
30068 pub squawk: u16,
30069 #[doc = "ADS-B transponder control state flags"]
30070 pub state: UavionixAdsbOutControlState,
30071 #[doc = "Emergency status"]
30072 pub emergencyStatus: UavionixAdsbEmergencyStatus,
30073 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable."]
30074 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30075 pub flight_id: [u8; 8],
30076 #[doc = "X-Bit enable (military transponders only)"]
30077 pub x_bit: UavionixAdsbXbit,
30078}
30079impl UAVIONIX_ADSB_OUT_CONTROL_DATA {
30080 pub const ENCODED_LEN: usize = 17usize;
30081 pub const DEFAULT: Self = Self {
30082 baroAltMSL: 0_i32,
30083 squawk: 0_u16,
30084 state: UavionixAdsbOutControlState::DEFAULT,
30085 emergencyStatus: UavionixAdsbEmergencyStatus::DEFAULT,
30086 flight_id: [0_u8; 8usize],
30087 x_bit: UavionixAdsbXbit::DEFAULT,
30088 };
30089 #[cfg(feature = "arbitrary")]
30090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30091 use arbitrary::{Arbitrary, Unstructured};
30092 let mut buf = [0u8; 1024];
30093 rng.fill_bytes(&mut buf);
30094 let mut unstructured = Unstructured::new(&buf);
30095 Self::arbitrary(&mut unstructured).unwrap_or_default()
30096 }
30097}
30098impl Default for UAVIONIX_ADSB_OUT_CONTROL_DATA {
30099 fn default() -> Self {
30100 Self::DEFAULT.clone()
30101 }
30102}
30103impl MessageData for UAVIONIX_ADSB_OUT_CONTROL_DATA {
30104 type Message = MavMessage;
30105 const ID: u32 = 10007u32;
30106 const NAME: &'static str = "UAVIONIX_ADSB_OUT_CONTROL";
30107 const EXTRA_CRC: u8 = 71u8;
30108 const ENCODED_LEN: usize = 17usize;
30109 fn deser(
30110 _version: MavlinkVersion,
30111 __input: &[u8],
30112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30113 let avail_len = __input.len();
30114 let mut payload_buf = [0; Self::ENCODED_LEN];
30115 let mut buf = if avail_len < Self::ENCODED_LEN {
30116 payload_buf[0..avail_len].copy_from_slice(__input);
30117 Bytes::new(&payload_buf)
30118 } else {
30119 Bytes::new(__input)
30120 };
30121 let mut __struct = Self::default();
30122 __struct.baroAltMSL = buf.get_i32_le();
30123 __struct.squawk = buf.get_u16_le();
30124 let tmp = buf.get_u8();
30125 __struct.state =
30126 UavionixAdsbOutControlState::from_bits(tmp & UavionixAdsbOutControlState::all().bits())
30127 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30128 flag_type: "UavionixAdsbOutControlState",
30129 value: tmp as u32,
30130 })?;
30131 let tmp = buf.get_u8();
30132 __struct.emergencyStatus =
30133 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30134 enum_type: "UavionixAdsbEmergencyStatus",
30135 value: tmp as u32,
30136 })?;
30137 for v in &mut __struct.flight_id {
30138 let val = buf.get_u8();
30139 *v = val;
30140 }
30141 let tmp = buf.get_u8();
30142 __struct.x_bit = UavionixAdsbXbit::from_bits(tmp & UavionixAdsbXbit::all().bits()).ok_or(
30143 ::mavlink_core::error::ParserError::InvalidFlag {
30144 flag_type: "UavionixAdsbXbit",
30145 value: tmp as u32,
30146 },
30147 )?;
30148 Ok(__struct)
30149 }
30150 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30151 let mut __tmp = BytesMut::new(bytes);
30152 #[allow(clippy::absurd_extreme_comparisons)]
30153 #[allow(unused_comparisons)]
30154 if __tmp.remaining() < Self::ENCODED_LEN {
30155 panic!(
30156 "buffer is too small (need {} bytes, but got {})",
30157 Self::ENCODED_LEN,
30158 __tmp.remaining(),
30159 )
30160 }
30161 __tmp.put_i32_le(self.baroAltMSL);
30162 __tmp.put_u16_le(self.squawk);
30163 __tmp.put_u8(self.state.bits());
30164 __tmp.put_u8(self.emergencyStatus as u8);
30165 for val in &self.flight_id {
30166 __tmp.put_u8(*val);
30167 }
30168 __tmp.put_u8(self.x_bit.bits());
30169 if matches!(version, MavlinkVersion::V2) {
30170 let len = __tmp.len();
30171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30172 } else {
30173 __tmp.len()
30174 }
30175 }
30176}
30177#[doc = "id: 10002"]
30178#[doc = "Dynamic data used to generate ADS-B out transponder data (send at 5Hz)."]
30179#[derive(Debug, Clone, PartialEq)]
30180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30182pub struct UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
30183 #[doc = "UTC time in seconds since GPS epoch (Jan 6, 1980). If unknown set to UINT32_MAX"]
30184 pub utcTime: u32,
30185 #[doc = "Latitude WGS84 (deg * 1E7). If unknown set to INT32_MAX"]
30186 pub gpsLat: i32,
30187 #[doc = "Longitude WGS84 (deg * 1E7). If unknown set to INT32_MAX"]
30188 pub gpsLon: i32,
30189 #[doc = "Altitude (WGS84). UP +ve. If unknown set to INT32_MAX"]
30190 pub gpsAlt: i32,
30191 #[doc = "Barometric pressure altitude (MSL) relative to a standard atmosphere of 1013.2 mBar and NOT bar corrected altitude (m * 1E-3). (up +ve). If unknown set to INT32_MAX"]
30192 pub baroAltMSL: i32,
30193 #[doc = "Horizontal accuracy in mm (m * 1E-3). If unknown set to UINT32_MAX"]
30194 pub accuracyHor: u32,
30195 #[doc = "Vertical accuracy in cm. If unknown set to UINT16_MAX"]
30196 pub accuracyVert: u16,
30197 #[doc = "Velocity accuracy in mm/s (m * 1E-3). If unknown set to UINT16_MAX"]
30198 pub accuracyVel: u16,
30199 #[doc = "GPS vertical speed in cm/s. If unknown set to INT16_MAX"]
30200 pub velVert: i16,
30201 #[doc = "North-South velocity over ground in cm/s North +ve. If unknown set to INT16_MAX"]
30202 pub velNS: i16,
30203 #[doc = "East-West velocity over ground in cm/s East +ve. If unknown set to INT16_MAX"]
30204 pub VelEW: i16,
30205 #[doc = "ADS-B transponder dynamic input state flags"]
30206 pub state: UavionixAdsbOutDynamicState,
30207 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
30208 pub squawk: u16,
30209 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS, 5: RTK"]
30210 pub gpsFix: UavionixAdsbOutDynamicGpsFix,
30211 #[doc = "Number of satellites visible. If unknown set to UINT8_MAX"]
30212 pub numSats: u8,
30213 #[doc = "Emergency status"]
30214 pub emergencyStatus: UavionixAdsbEmergencyStatus,
30215}
30216impl UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
30217 pub const ENCODED_LEN: usize = 41usize;
30218 pub const DEFAULT: Self = Self {
30219 utcTime: 0_u32,
30220 gpsLat: 0_i32,
30221 gpsLon: 0_i32,
30222 gpsAlt: 0_i32,
30223 baroAltMSL: 0_i32,
30224 accuracyHor: 0_u32,
30225 accuracyVert: 0_u16,
30226 accuracyVel: 0_u16,
30227 velVert: 0_i16,
30228 velNS: 0_i16,
30229 VelEW: 0_i16,
30230 state: UavionixAdsbOutDynamicState::DEFAULT,
30231 squawk: 0_u16,
30232 gpsFix: UavionixAdsbOutDynamicGpsFix::DEFAULT,
30233 numSats: 0_u8,
30234 emergencyStatus: UavionixAdsbEmergencyStatus::DEFAULT,
30235 };
30236 #[cfg(feature = "arbitrary")]
30237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30238 use arbitrary::{Arbitrary, Unstructured};
30239 let mut buf = [0u8; 1024];
30240 rng.fill_bytes(&mut buf);
30241 let mut unstructured = Unstructured::new(&buf);
30242 Self::arbitrary(&mut unstructured).unwrap_or_default()
30243 }
30244}
30245impl Default for UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
30246 fn default() -> Self {
30247 Self::DEFAULT.clone()
30248 }
30249}
30250impl MessageData for UAVIONIX_ADSB_OUT_DYNAMIC_DATA {
30251 type Message = MavMessage;
30252 const ID: u32 = 10002u32;
30253 const NAME: &'static str = "UAVIONIX_ADSB_OUT_DYNAMIC";
30254 const EXTRA_CRC: u8 = 186u8;
30255 const ENCODED_LEN: usize = 41usize;
30256 fn deser(
30257 _version: MavlinkVersion,
30258 __input: &[u8],
30259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30260 let avail_len = __input.len();
30261 let mut payload_buf = [0; Self::ENCODED_LEN];
30262 let mut buf = if avail_len < Self::ENCODED_LEN {
30263 payload_buf[0..avail_len].copy_from_slice(__input);
30264 Bytes::new(&payload_buf)
30265 } else {
30266 Bytes::new(__input)
30267 };
30268 let mut __struct = Self::default();
30269 __struct.utcTime = buf.get_u32_le();
30270 __struct.gpsLat = buf.get_i32_le();
30271 __struct.gpsLon = buf.get_i32_le();
30272 __struct.gpsAlt = buf.get_i32_le();
30273 __struct.baroAltMSL = buf.get_i32_le();
30274 __struct.accuracyHor = buf.get_u32_le();
30275 __struct.accuracyVert = buf.get_u16_le();
30276 __struct.accuracyVel = buf.get_u16_le();
30277 __struct.velVert = buf.get_i16_le();
30278 __struct.velNS = buf.get_i16_le();
30279 __struct.VelEW = buf.get_i16_le();
30280 let tmp = buf.get_u16_le();
30281 __struct.state =
30282 UavionixAdsbOutDynamicState::from_bits(tmp & UavionixAdsbOutDynamicState::all().bits())
30283 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30284 flag_type: "UavionixAdsbOutDynamicState",
30285 value: tmp as u32,
30286 })?;
30287 __struct.squawk = buf.get_u16_le();
30288 let tmp = buf.get_u8();
30289 __struct.gpsFix =
30290 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30291 enum_type: "UavionixAdsbOutDynamicGpsFix",
30292 value: tmp as u32,
30293 })?;
30294 __struct.numSats = buf.get_u8();
30295 let tmp = buf.get_u8();
30296 __struct.emergencyStatus =
30297 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30298 enum_type: "UavionixAdsbEmergencyStatus",
30299 value: tmp as u32,
30300 })?;
30301 Ok(__struct)
30302 }
30303 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30304 let mut __tmp = BytesMut::new(bytes);
30305 #[allow(clippy::absurd_extreme_comparisons)]
30306 #[allow(unused_comparisons)]
30307 if __tmp.remaining() < Self::ENCODED_LEN {
30308 panic!(
30309 "buffer is too small (need {} bytes, but got {})",
30310 Self::ENCODED_LEN,
30311 __tmp.remaining(),
30312 )
30313 }
30314 __tmp.put_u32_le(self.utcTime);
30315 __tmp.put_i32_le(self.gpsLat);
30316 __tmp.put_i32_le(self.gpsLon);
30317 __tmp.put_i32_le(self.gpsAlt);
30318 __tmp.put_i32_le(self.baroAltMSL);
30319 __tmp.put_u32_le(self.accuracyHor);
30320 __tmp.put_u16_le(self.accuracyVert);
30321 __tmp.put_u16_le(self.accuracyVel);
30322 __tmp.put_i16_le(self.velVert);
30323 __tmp.put_i16_le(self.velNS);
30324 __tmp.put_i16_le(self.VelEW);
30325 __tmp.put_u16_le(self.state.bits());
30326 __tmp.put_u16_le(self.squawk);
30327 __tmp.put_u8(self.gpsFix as u8);
30328 __tmp.put_u8(self.numSats);
30329 __tmp.put_u8(self.emergencyStatus as u8);
30330 if matches!(version, MavlinkVersion::V2) {
30331 let len = __tmp.len();
30332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30333 } else {
30334 __tmp.len()
30335 }
30336 }
30337}
30338#[doc = "id: 10008"]
30339#[doc = "Status message with information from UCP Heartbeat and Status messages."]
30340#[derive(Debug, Clone, PartialEq)]
30341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30343pub struct UAVIONIX_ADSB_OUT_STATUS_DATA {
30344 #[doc = "Mode A code (typically 1200 [0x04B0] for VFR)"]
30345 pub squawk: u16,
30346 #[doc = "ADS-B transponder status state flags"]
30347 pub state: UavionixAdsbOutStatusState,
30348 #[doc = "Integrity and Accuracy of traffic reported as a 4-bit value for each field (NACp 7:4, NIC 3:0) and encoded by Containment Radius (HPL) and Estimated Position Uncertainty (HFOM), respectively"]
30349 pub NIC_NACp: UavionixAdsbOutStatusNicNacp,
30350 #[doc = "Board temperature in C"]
30351 pub boardTemp: u8,
30352 #[doc = "ADS-B transponder fault flags"]
30353 pub fault: UavionixAdsbOutStatusFault,
30354 #[doc = "Flight Identification: 8 ASCII characters, '0' through '9', 'A' through 'Z' or space. Spaces (0x20) used as a trailing pad character, or when call sign is unavailable."]
30355 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30356 pub flight_id: [u8; 8],
30357}
30358impl UAVIONIX_ADSB_OUT_STATUS_DATA {
30359 pub const ENCODED_LEN: usize = 14usize;
30360 pub const DEFAULT: Self = Self {
30361 squawk: 0_u16,
30362 state: UavionixAdsbOutStatusState::DEFAULT,
30363 NIC_NACp: UavionixAdsbOutStatusNicNacp::DEFAULT,
30364 boardTemp: 0_u8,
30365 fault: UavionixAdsbOutStatusFault::DEFAULT,
30366 flight_id: [0_u8; 8usize],
30367 };
30368 #[cfg(feature = "arbitrary")]
30369 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30370 use arbitrary::{Arbitrary, Unstructured};
30371 let mut buf = [0u8; 1024];
30372 rng.fill_bytes(&mut buf);
30373 let mut unstructured = Unstructured::new(&buf);
30374 Self::arbitrary(&mut unstructured).unwrap_or_default()
30375 }
30376}
30377impl Default for UAVIONIX_ADSB_OUT_STATUS_DATA {
30378 fn default() -> Self {
30379 Self::DEFAULT.clone()
30380 }
30381}
30382impl MessageData for UAVIONIX_ADSB_OUT_STATUS_DATA {
30383 type Message = MavMessage;
30384 const ID: u32 = 10008u32;
30385 const NAME: &'static str = "UAVIONIX_ADSB_OUT_STATUS";
30386 const EXTRA_CRC: u8 = 240u8;
30387 const ENCODED_LEN: usize = 14usize;
30388 fn deser(
30389 _version: MavlinkVersion,
30390 __input: &[u8],
30391 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30392 let avail_len = __input.len();
30393 let mut payload_buf = [0; Self::ENCODED_LEN];
30394 let mut buf = if avail_len < Self::ENCODED_LEN {
30395 payload_buf[0..avail_len].copy_from_slice(__input);
30396 Bytes::new(&payload_buf)
30397 } else {
30398 Bytes::new(__input)
30399 };
30400 let mut __struct = Self::default();
30401 __struct.squawk = buf.get_u16_le();
30402 let tmp = buf.get_u8();
30403 __struct.state =
30404 UavionixAdsbOutStatusState::from_bits(tmp & UavionixAdsbOutStatusState::all().bits())
30405 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30406 flag_type: "UavionixAdsbOutStatusState",
30407 value: tmp as u32,
30408 })?;
30409 let tmp = buf.get_u8();
30410 __struct.NIC_NACp =
30411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30412 enum_type: "UavionixAdsbOutStatusNicNacp",
30413 value: tmp as u32,
30414 })?;
30415 __struct.boardTemp = buf.get_u8();
30416 let tmp = buf.get_u8();
30417 __struct.fault =
30418 UavionixAdsbOutStatusFault::from_bits(tmp & UavionixAdsbOutStatusFault::all().bits())
30419 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30420 flag_type: "UavionixAdsbOutStatusFault",
30421 value: tmp as u32,
30422 })?;
30423 for v in &mut __struct.flight_id {
30424 let val = buf.get_u8();
30425 *v = val;
30426 }
30427 Ok(__struct)
30428 }
30429 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30430 let mut __tmp = BytesMut::new(bytes);
30431 #[allow(clippy::absurd_extreme_comparisons)]
30432 #[allow(unused_comparisons)]
30433 if __tmp.remaining() < Self::ENCODED_LEN {
30434 panic!(
30435 "buffer is too small (need {} bytes, but got {})",
30436 Self::ENCODED_LEN,
30437 __tmp.remaining(),
30438 )
30439 }
30440 __tmp.put_u16_le(self.squawk);
30441 __tmp.put_u8(self.state.bits());
30442 __tmp.put_u8(self.NIC_NACp as u8);
30443 __tmp.put_u8(self.boardTemp);
30444 __tmp.put_u8(self.fault.bits());
30445 for val in &self.flight_id {
30446 __tmp.put_u8(*val);
30447 }
30448 if matches!(version, MavlinkVersion::V2) {
30449 let len = __tmp.len();
30450 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30451 } else {
30452 __tmp.len()
30453 }
30454 }
30455}
30456#[doc = "id: 10003"]
30457#[doc = "Transceiver heartbeat with health report (updated every 10s)."]
30458#[derive(Debug, Clone, PartialEq)]
30459#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30460#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30461pub struct UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
30462 #[doc = "ADS-B transponder messages"]
30463 pub rfHealth: UavionixAdsbRfHealth,
30464}
30465impl UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
30466 pub const ENCODED_LEN: usize = 1usize;
30467 pub const DEFAULT: Self = Self {
30468 rfHealth: UavionixAdsbRfHealth::DEFAULT,
30469 };
30470 #[cfg(feature = "arbitrary")]
30471 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30472 use arbitrary::{Arbitrary, Unstructured};
30473 let mut buf = [0u8; 1024];
30474 rng.fill_bytes(&mut buf);
30475 let mut unstructured = Unstructured::new(&buf);
30476 Self::arbitrary(&mut unstructured).unwrap_or_default()
30477 }
30478}
30479impl Default for UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
30480 fn default() -> Self {
30481 Self::DEFAULT.clone()
30482 }
30483}
30484impl MessageData for UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA {
30485 type Message = MavMessage;
30486 const ID: u32 = 10003u32;
30487 const NAME: &'static str = "UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT";
30488 const EXTRA_CRC: u8 = 4u8;
30489 const ENCODED_LEN: usize = 1usize;
30490 fn deser(
30491 _version: MavlinkVersion,
30492 __input: &[u8],
30493 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30494 let avail_len = __input.len();
30495 let mut payload_buf = [0; Self::ENCODED_LEN];
30496 let mut buf = if avail_len < Self::ENCODED_LEN {
30497 payload_buf[0..avail_len].copy_from_slice(__input);
30498 Bytes::new(&payload_buf)
30499 } else {
30500 Bytes::new(__input)
30501 };
30502 let mut __struct = Self::default();
30503 let tmp = buf.get_u8();
30504 __struct.rfHealth = UavionixAdsbRfHealth::from_bits(
30505 tmp & UavionixAdsbRfHealth::all().bits(),
30506 )
30507 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30508 flag_type: "UavionixAdsbRfHealth",
30509 value: tmp as u32,
30510 })?;
30511 Ok(__struct)
30512 }
30513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30514 let mut __tmp = BytesMut::new(bytes);
30515 #[allow(clippy::absurd_extreme_comparisons)]
30516 #[allow(unused_comparisons)]
30517 if __tmp.remaining() < Self::ENCODED_LEN {
30518 panic!(
30519 "buffer is too small (need {} bytes, but got {})",
30520 Self::ENCODED_LEN,
30521 __tmp.remaining(),
30522 )
30523 }
30524 __tmp.put_u8(self.rfHealth.bits());
30525 if matches!(version, MavlinkVersion::V2) {
30526 let len = __tmp.len();
30527 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30528 } else {
30529 __tmp.len()
30530 }
30531 }
30532}
30533#[doc = "id: 340"]
30534#[doc = "The global position resulting from GPS and sensor fusion."]
30535#[derive(Debug, Clone, PartialEq)]
30536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30538pub struct UTM_GLOBAL_POSITION_DATA {
30539 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30540 pub time: u64,
30541 #[doc = "Latitude (WGS84)"]
30542 pub lat: i32,
30543 #[doc = "Longitude (WGS84)"]
30544 pub lon: i32,
30545 #[doc = "Altitude (WGS84)"]
30546 pub alt: i32,
30547 #[doc = "Altitude above ground"]
30548 pub relative_alt: i32,
30549 #[doc = "Next waypoint, latitude (WGS84)"]
30550 pub next_lat: i32,
30551 #[doc = "Next waypoint, longitude (WGS84)"]
30552 pub next_lon: i32,
30553 #[doc = "Next waypoint, altitude (WGS84)"]
30554 pub next_alt: i32,
30555 #[doc = "Ground X speed (latitude, positive north)"]
30556 pub vx: i16,
30557 #[doc = "Ground Y speed (longitude, positive east)"]
30558 pub vy: i16,
30559 #[doc = "Ground Z speed (altitude, positive down)"]
30560 pub vz: i16,
30561 #[doc = "Horizontal position uncertainty (standard deviation)"]
30562 pub h_acc: u16,
30563 #[doc = "Altitude uncertainty (standard deviation)"]
30564 pub v_acc: u16,
30565 #[doc = "Speed uncertainty (standard deviation)"]
30566 pub vel_acc: u16,
30567 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30568 pub update_rate: u16,
30569 #[doc = "Unique UAS ID."]
30570 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30571 pub uas_id: [u8; 18],
30572 #[doc = "Flight state"]
30573 pub flight_state: UtmFlightState,
30574 #[doc = "Bitwise OR combination of the data available flags."]
30575 pub flags: UtmDataAvailFlags,
30576}
30577impl UTM_GLOBAL_POSITION_DATA {
30578 pub const ENCODED_LEN: usize = 70usize;
30579 pub const DEFAULT: Self = Self {
30580 time: 0_u64,
30581 lat: 0_i32,
30582 lon: 0_i32,
30583 alt: 0_i32,
30584 relative_alt: 0_i32,
30585 next_lat: 0_i32,
30586 next_lon: 0_i32,
30587 next_alt: 0_i32,
30588 vx: 0_i16,
30589 vy: 0_i16,
30590 vz: 0_i16,
30591 h_acc: 0_u16,
30592 v_acc: 0_u16,
30593 vel_acc: 0_u16,
30594 update_rate: 0_u16,
30595 uas_id: [0_u8; 18usize],
30596 flight_state: UtmFlightState::DEFAULT,
30597 flags: UtmDataAvailFlags::DEFAULT,
30598 };
30599 #[cfg(feature = "arbitrary")]
30600 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30601 use arbitrary::{Arbitrary, Unstructured};
30602 let mut buf = [0u8; 1024];
30603 rng.fill_bytes(&mut buf);
30604 let mut unstructured = Unstructured::new(&buf);
30605 Self::arbitrary(&mut unstructured).unwrap_or_default()
30606 }
30607}
30608impl Default for UTM_GLOBAL_POSITION_DATA {
30609 fn default() -> Self {
30610 Self::DEFAULT.clone()
30611 }
30612}
30613impl MessageData for UTM_GLOBAL_POSITION_DATA {
30614 type Message = MavMessage;
30615 const ID: u32 = 340u32;
30616 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30617 const EXTRA_CRC: u8 = 99u8;
30618 const ENCODED_LEN: usize = 70usize;
30619 fn deser(
30620 _version: MavlinkVersion,
30621 __input: &[u8],
30622 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30623 let avail_len = __input.len();
30624 let mut payload_buf = [0; Self::ENCODED_LEN];
30625 let mut buf = if avail_len < Self::ENCODED_LEN {
30626 payload_buf[0..avail_len].copy_from_slice(__input);
30627 Bytes::new(&payload_buf)
30628 } else {
30629 Bytes::new(__input)
30630 };
30631 let mut __struct = Self::default();
30632 __struct.time = buf.get_u64_le();
30633 __struct.lat = buf.get_i32_le();
30634 __struct.lon = buf.get_i32_le();
30635 __struct.alt = buf.get_i32_le();
30636 __struct.relative_alt = buf.get_i32_le();
30637 __struct.next_lat = buf.get_i32_le();
30638 __struct.next_lon = buf.get_i32_le();
30639 __struct.next_alt = buf.get_i32_le();
30640 __struct.vx = buf.get_i16_le();
30641 __struct.vy = buf.get_i16_le();
30642 __struct.vz = buf.get_i16_le();
30643 __struct.h_acc = buf.get_u16_le();
30644 __struct.v_acc = buf.get_u16_le();
30645 __struct.vel_acc = buf.get_u16_le();
30646 __struct.update_rate = buf.get_u16_le();
30647 for v in &mut __struct.uas_id {
30648 let val = buf.get_u8();
30649 *v = val;
30650 }
30651 let tmp = buf.get_u8();
30652 __struct.flight_state =
30653 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30654 enum_type: "UtmFlightState",
30655 value: tmp as u32,
30656 })?;
30657 let tmp = buf.get_u8();
30658 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
30659 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30660 flag_type: "UtmDataAvailFlags",
30661 value: tmp as u32,
30662 })?;
30663 Ok(__struct)
30664 }
30665 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30666 let mut __tmp = BytesMut::new(bytes);
30667 #[allow(clippy::absurd_extreme_comparisons)]
30668 #[allow(unused_comparisons)]
30669 if __tmp.remaining() < Self::ENCODED_LEN {
30670 panic!(
30671 "buffer is too small (need {} bytes, but got {})",
30672 Self::ENCODED_LEN,
30673 __tmp.remaining(),
30674 )
30675 }
30676 __tmp.put_u64_le(self.time);
30677 __tmp.put_i32_le(self.lat);
30678 __tmp.put_i32_le(self.lon);
30679 __tmp.put_i32_le(self.alt);
30680 __tmp.put_i32_le(self.relative_alt);
30681 __tmp.put_i32_le(self.next_lat);
30682 __tmp.put_i32_le(self.next_lon);
30683 __tmp.put_i32_le(self.next_alt);
30684 __tmp.put_i16_le(self.vx);
30685 __tmp.put_i16_le(self.vy);
30686 __tmp.put_i16_le(self.vz);
30687 __tmp.put_u16_le(self.h_acc);
30688 __tmp.put_u16_le(self.v_acc);
30689 __tmp.put_u16_le(self.vel_acc);
30690 __tmp.put_u16_le(self.update_rate);
30691 for val in &self.uas_id {
30692 __tmp.put_u8(*val);
30693 }
30694 __tmp.put_u8(self.flight_state as u8);
30695 __tmp.put_u8(self.flags.bits());
30696 if matches!(version, MavlinkVersion::V2) {
30697 let len = __tmp.len();
30698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30699 } else {
30700 __tmp.len()
30701 }
30702 }
30703}
30704#[doc = "id: 248"]
30705#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30706#[derive(Debug, Clone, PartialEq)]
30707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30709pub struct V2_EXTENSION_DATA {
30710 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30711 pub message_type: u16,
30712 #[doc = "Network ID (0 for broadcast)"]
30713 pub target_network: u8,
30714 #[doc = "System ID (0 for broadcast)"]
30715 pub target_system: u8,
30716 #[doc = "Component ID (0 for broadcast)"]
30717 pub target_component: u8,
30718 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30719 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30720 pub payload: [u8; 249],
30721}
30722impl V2_EXTENSION_DATA {
30723 pub const ENCODED_LEN: usize = 254usize;
30724 pub const DEFAULT: Self = Self {
30725 message_type: 0_u16,
30726 target_network: 0_u8,
30727 target_system: 0_u8,
30728 target_component: 0_u8,
30729 payload: [0_u8; 249usize],
30730 };
30731 #[cfg(feature = "arbitrary")]
30732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30733 use arbitrary::{Arbitrary, Unstructured};
30734 let mut buf = [0u8; 1024];
30735 rng.fill_bytes(&mut buf);
30736 let mut unstructured = Unstructured::new(&buf);
30737 Self::arbitrary(&mut unstructured).unwrap_or_default()
30738 }
30739}
30740impl Default for V2_EXTENSION_DATA {
30741 fn default() -> Self {
30742 Self::DEFAULT.clone()
30743 }
30744}
30745impl MessageData for V2_EXTENSION_DATA {
30746 type Message = MavMessage;
30747 const ID: u32 = 248u32;
30748 const NAME: &'static str = "V2_EXTENSION";
30749 const EXTRA_CRC: u8 = 8u8;
30750 const ENCODED_LEN: usize = 254usize;
30751 fn deser(
30752 _version: MavlinkVersion,
30753 __input: &[u8],
30754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30755 let avail_len = __input.len();
30756 let mut payload_buf = [0; Self::ENCODED_LEN];
30757 let mut buf = if avail_len < Self::ENCODED_LEN {
30758 payload_buf[0..avail_len].copy_from_slice(__input);
30759 Bytes::new(&payload_buf)
30760 } else {
30761 Bytes::new(__input)
30762 };
30763 let mut __struct = Self::default();
30764 __struct.message_type = buf.get_u16_le();
30765 __struct.target_network = buf.get_u8();
30766 __struct.target_system = buf.get_u8();
30767 __struct.target_component = buf.get_u8();
30768 for v in &mut __struct.payload {
30769 let val = buf.get_u8();
30770 *v = val;
30771 }
30772 Ok(__struct)
30773 }
30774 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30775 let mut __tmp = BytesMut::new(bytes);
30776 #[allow(clippy::absurd_extreme_comparisons)]
30777 #[allow(unused_comparisons)]
30778 if __tmp.remaining() < Self::ENCODED_LEN {
30779 panic!(
30780 "buffer is too small (need {} bytes, but got {})",
30781 Self::ENCODED_LEN,
30782 __tmp.remaining(),
30783 )
30784 }
30785 __tmp.put_u16_le(self.message_type);
30786 __tmp.put_u8(self.target_network);
30787 __tmp.put_u8(self.target_system);
30788 __tmp.put_u8(self.target_component);
30789 for val in &self.payload {
30790 __tmp.put_u8(*val);
30791 }
30792 if matches!(version, MavlinkVersion::V2) {
30793 let len = __tmp.len();
30794 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30795 } else {
30796 __tmp.len()
30797 }
30798 }
30799}
30800#[doc = "id: 74"]
30801#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30802#[derive(Debug, Clone, PartialEq)]
30803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30804#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30805pub struct VFR_HUD_DATA {
30806 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30807 pub airspeed: f32,
30808 #[doc = "Current ground speed."]
30809 pub groundspeed: f32,
30810 #[doc = "Current altitude (MSL)."]
30811 pub alt: f32,
30812 #[doc = "Current climb rate."]
30813 pub climb: f32,
30814 #[doc = "Current heading in compass units (0-360, 0=north)."]
30815 pub heading: i16,
30816 #[doc = "Current throttle setting (0 to 100)."]
30817 pub throttle: u16,
30818}
30819impl VFR_HUD_DATA {
30820 pub const ENCODED_LEN: usize = 20usize;
30821 pub const DEFAULT: Self = Self {
30822 airspeed: 0.0_f32,
30823 groundspeed: 0.0_f32,
30824 alt: 0.0_f32,
30825 climb: 0.0_f32,
30826 heading: 0_i16,
30827 throttle: 0_u16,
30828 };
30829 #[cfg(feature = "arbitrary")]
30830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30831 use arbitrary::{Arbitrary, Unstructured};
30832 let mut buf = [0u8; 1024];
30833 rng.fill_bytes(&mut buf);
30834 let mut unstructured = Unstructured::new(&buf);
30835 Self::arbitrary(&mut unstructured).unwrap_or_default()
30836 }
30837}
30838impl Default for VFR_HUD_DATA {
30839 fn default() -> Self {
30840 Self::DEFAULT.clone()
30841 }
30842}
30843impl MessageData for VFR_HUD_DATA {
30844 type Message = MavMessage;
30845 const ID: u32 = 74u32;
30846 const NAME: &'static str = "VFR_HUD";
30847 const EXTRA_CRC: u8 = 20u8;
30848 const ENCODED_LEN: usize = 20usize;
30849 fn deser(
30850 _version: MavlinkVersion,
30851 __input: &[u8],
30852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30853 let avail_len = __input.len();
30854 let mut payload_buf = [0; Self::ENCODED_LEN];
30855 let mut buf = if avail_len < Self::ENCODED_LEN {
30856 payload_buf[0..avail_len].copy_from_slice(__input);
30857 Bytes::new(&payload_buf)
30858 } else {
30859 Bytes::new(__input)
30860 };
30861 let mut __struct = Self::default();
30862 __struct.airspeed = buf.get_f32_le();
30863 __struct.groundspeed = buf.get_f32_le();
30864 __struct.alt = buf.get_f32_le();
30865 __struct.climb = buf.get_f32_le();
30866 __struct.heading = buf.get_i16_le();
30867 __struct.throttle = buf.get_u16_le();
30868 Ok(__struct)
30869 }
30870 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30871 let mut __tmp = BytesMut::new(bytes);
30872 #[allow(clippy::absurd_extreme_comparisons)]
30873 #[allow(unused_comparisons)]
30874 if __tmp.remaining() < Self::ENCODED_LEN {
30875 panic!(
30876 "buffer is too small (need {} bytes, but got {})",
30877 Self::ENCODED_LEN,
30878 __tmp.remaining(),
30879 )
30880 }
30881 __tmp.put_f32_le(self.airspeed);
30882 __tmp.put_f32_le(self.groundspeed);
30883 __tmp.put_f32_le(self.alt);
30884 __tmp.put_f32_le(self.climb);
30885 __tmp.put_i16_le(self.heading);
30886 __tmp.put_u16_le(self.throttle);
30887 if matches!(version, MavlinkVersion::V2) {
30888 let len = __tmp.len();
30889 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30890 } else {
30891 __tmp.len()
30892 }
30893 }
30894}
30895#[doc = "id: 241"]
30896#[doc = "Vibration levels and accelerometer clipping."]
30897#[derive(Debug, Clone, PartialEq)]
30898#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30900pub struct VIBRATION_DATA {
30901 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30902 pub time_usec: u64,
30903 #[doc = "Vibration levels on X-axis"]
30904 pub vibration_x: f32,
30905 #[doc = "Vibration levels on Y-axis"]
30906 pub vibration_y: f32,
30907 #[doc = "Vibration levels on Z-axis"]
30908 pub vibration_z: f32,
30909 #[doc = "first accelerometer clipping count"]
30910 pub clipping_0: u32,
30911 #[doc = "second accelerometer clipping count"]
30912 pub clipping_1: u32,
30913 #[doc = "third accelerometer clipping count"]
30914 pub clipping_2: u32,
30915}
30916impl VIBRATION_DATA {
30917 pub const ENCODED_LEN: usize = 32usize;
30918 pub const DEFAULT: Self = Self {
30919 time_usec: 0_u64,
30920 vibration_x: 0.0_f32,
30921 vibration_y: 0.0_f32,
30922 vibration_z: 0.0_f32,
30923 clipping_0: 0_u32,
30924 clipping_1: 0_u32,
30925 clipping_2: 0_u32,
30926 };
30927 #[cfg(feature = "arbitrary")]
30928 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30929 use arbitrary::{Arbitrary, Unstructured};
30930 let mut buf = [0u8; 1024];
30931 rng.fill_bytes(&mut buf);
30932 let mut unstructured = Unstructured::new(&buf);
30933 Self::arbitrary(&mut unstructured).unwrap_or_default()
30934 }
30935}
30936impl Default for VIBRATION_DATA {
30937 fn default() -> Self {
30938 Self::DEFAULT.clone()
30939 }
30940}
30941impl MessageData for VIBRATION_DATA {
30942 type Message = MavMessage;
30943 const ID: u32 = 241u32;
30944 const NAME: &'static str = "VIBRATION";
30945 const EXTRA_CRC: u8 = 90u8;
30946 const ENCODED_LEN: usize = 32usize;
30947 fn deser(
30948 _version: MavlinkVersion,
30949 __input: &[u8],
30950 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30951 let avail_len = __input.len();
30952 let mut payload_buf = [0; Self::ENCODED_LEN];
30953 let mut buf = if avail_len < Self::ENCODED_LEN {
30954 payload_buf[0..avail_len].copy_from_slice(__input);
30955 Bytes::new(&payload_buf)
30956 } else {
30957 Bytes::new(__input)
30958 };
30959 let mut __struct = Self::default();
30960 __struct.time_usec = buf.get_u64_le();
30961 __struct.vibration_x = buf.get_f32_le();
30962 __struct.vibration_y = buf.get_f32_le();
30963 __struct.vibration_z = buf.get_f32_le();
30964 __struct.clipping_0 = buf.get_u32_le();
30965 __struct.clipping_1 = buf.get_u32_le();
30966 __struct.clipping_2 = buf.get_u32_le();
30967 Ok(__struct)
30968 }
30969 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30970 let mut __tmp = BytesMut::new(bytes);
30971 #[allow(clippy::absurd_extreme_comparisons)]
30972 #[allow(unused_comparisons)]
30973 if __tmp.remaining() < Self::ENCODED_LEN {
30974 panic!(
30975 "buffer is too small (need {} bytes, but got {})",
30976 Self::ENCODED_LEN,
30977 __tmp.remaining(),
30978 )
30979 }
30980 __tmp.put_u64_le(self.time_usec);
30981 __tmp.put_f32_le(self.vibration_x);
30982 __tmp.put_f32_le(self.vibration_y);
30983 __tmp.put_f32_le(self.vibration_z);
30984 __tmp.put_u32_le(self.clipping_0);
30985 __tmp.put_u32_le(self.clipping_1);
30986 __tmp.put_u32_le(self.clipping_2);
30987 if matches!(version, MavlinkVersion::V2) {
30988 let len = __tmp.len();
30989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30990 } else {
30991 __tmp.len()
30992 }
30993 }
30994}
30995#[doc = "id: 104"]
30996#[doc = "Global position estimate from a Vicon motion system source."]
30997#[derive(Debug, Clone, PartialEq)]
30998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31000pub struct VICON_POSITION_ESTIMATE_DATA {
31001 #[doc = "Timestamp (UNIX time or time since system boot)"]
31002 pub usec: u64,
31003 #[doc = "Global X position"]
31004 pub x: f32,
31005 #[doc = "Global Y position"]
31006 pub y: f32,
31007 #[doc = "Global Z position"]
31008 pub z: f32,
31009 #[doc = "Roll angle"]
31010 pub roll: f32,
31011 #[doc = "Pitch angle"]
31012 pub pitch: f32,
31013 #[doc = "Yaw angle"]
31014 pub yaw: f32,
31015 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31016 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31017 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31018 pub covariance: [f32; 21],
31019}
31020impl VICON_POSITION_ESTIMATE_DATA {
31021 pub const ENCODED_LEN: usize = 116usize;
31022 pub const DEFAULT: Self = Self {
31023 usec: 0_u64,
31024 x: 0.0_f32,
31025 y: 0.0_f32,
31026 z: 0.0_f32,
31027 roll: 0.0_f32,
31028 pitch: 0.0_f32,
31029 yaw: 0.0_f32,
31030 covariance: [0.0_f32; 21usize],
31031 };
31032 #[cfg(feature = "arbitrary")]
31033 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31034 use arbitrary::{Arbitrary, Unstructured};
31035 let mut buf = [0u8; 1024];
31036 rng.fill_bytes(&mut buf);
31037 let mut unstructured = Unstructured::new(&buf);
31038 Self::arbitrary(&mut unstructured).unwrap_or_default()
31039 }
31040}
31041impl Default for VICON_POSITION_ESTIMATE_DATA {
31042 fn default() -> Self {
31043 Self::DEFAULT.clone()
31044 }
31045}
31046impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31047 type Message = MavMessage;
31048 const ID: u32 = 104u32;
31049 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31050 const EXTRA_CRC: u8 = 56u8;
31051 const ENCODED_LEN: usize = 116usize;
31052 fn deser(
31053 _version: MavlinkVersion,
31054 __input: &[u8],
31055 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31056 let avail_len = __input.len();
31057 let mut payload_buf = [0; Self::ENCODED_LEN];
31058 let mut buf = if avail_len < Self::ENCODED_LEN {
31059 payload_buf[0..avail_len].copy_from_slice(__input);
31060 Bytes::new(&payload_buf)
31061 } else {
31062 Bytes::new(__input)
31063 };
31064 let mut __struct = Self::default();
31065 __struct.usec = buf.get_u64_le();
31066 __struct.x = buf.get_f32_le();
31067 __struct.y = buf.get_f32_le();
31068 __struct.z = buf.get_f32_le();
31069 __struct.roll = buf.get_f32_le();
31070 __struct.pitch = buf.get_f32_le();
31071 __struct.yaw = buf.get_f32_le();
31072 for v in &mut __struct.covariance {
31073 let val = buf.get_f32_le();
31074 *v = val;
31075 }
31076 Ok(__struct)
31077 }
31078 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31079 let mut __tmp = BytesMut::new(bytes);
31080 #[allow(clippy::absurd_extreme_comparisons)]
31081 #[allow(unused_comparisons)]
31082 if __tmp.remaining() < Self::ENCODED_LEN {
31083 panic!(
31084 "buffer is too small (need {} bytes, but got {})",
31085 Self::ENCODED_LEN,
31086 __tmp.remaining(),
31087 )
31088 }
31089 __tmp.put_u64_le(self.usec);
31090 __tmp.put_f32_le(self.x);
31091 __tmp.put_f32_le(self.y);
31092 __tmp.put_f32_le(self.z);
31093 __tmp.put_f32_le(self.roll);
31094 __tmp.put_f32_le(self.pitch);
31095 __tmp.put_f32_le(self.yaw);
31096 for val in &self.covariance {
31097 __tmp.put_f32_le(*val);
31098 }
31099 if matches!(version, MavlinkVersion::V2) {
31100 let len = __tmp.len();
31101 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31102 } else {
31103 __tmp.len()
31104 }
31105 }
31106}
31107#[doc = "id: 269"]
31108#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
31109#[derive(Debug, Clone, PartialEq)]
31110#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31111#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31112pub struct VIDEO_STREAM_INFORMATION_DATA {
31113 #[doc = "Frame rate."]
31114 pub framerate: f32,
31115 #[doc = "Bit rate."]
31116 pub bitrate: u32,
31117 #[doc = "Bitmap of stream status flags."]
31118 pub flags: VideoStreamStatusFlags,
31119 #[doc = "Horizontal resolution."]
31120 pub resolution_h: u16,
31121 #[doc = "Vertical resolution."]
31122 pub resolution_v: u16,
31123 #[doc = "Video image rotation clockwise."]
31124 pub rotation: u16,
31125 #[doc = "Horizontal Field of view."]
31126 pub hfov: u16,
31127 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31128 pub stream_id: u8,
31129 #[doc = "Number of streams available."]
31130 pub count: u8,
31131 #[doc = "Type of stream."]
31132 pub mavtype: VideoStreamType,
31133 #[doc = "Stream name."]
31134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31135 pub name: [u8; 32],
31136 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
31137 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31138 pub uri: [u8; 160],
31139 #[doc = "Encoding of stream."]
31140 #[cfg_attr(feature = "serde", serde(default))]
31141 pub encoding: VideoStreamEncoding,
31142 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31143 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31144 pub camera_device_id: u8,
31145}
31146impl VIDEO_STREAM_INFORMATION_DATA {
31147 pub const ENCODED_LEN: usize = 215usize;
31148 pub const DEFAULT: Self = Self {
31149 framerate: 0.0_f32,
31150 bitrate: 0_u32,
31151 flags: VideoStreamStatusFlags::DEFAULT,
31152 resolution_h: 0_u16,
31153 resolution_v: 0_u16,
31154 rotation: 0_u16,
31155 hfov: 0_u16,
31156 stream_id: 0_u8,
31157 count: 0_u8,
31158 mavtype: VideoStreamType::DEFAULT,
31159 name: [0_u8; 32usize],
31160 uri: [0_u8; 160usize],
31161 encoding: VideoStreamEncoding::DEFAULT,
31162 camera_device_id: 0_u8,
31163 };
31164 #[cfg(feature = "arbitrary")]
31165 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31166 use arbitrary::{Arbitrary, Unstructured};
31167 let mut buf = [0u8; 1024];
31168 rng.fill_bytes(&mut buf);
31169 let mut unstructured = Unstructured::new(&buf);
31170 Self::arbitrary(&mut unstructured).unwrap_or_default()
31171 }
31172}
31173impl Default for VIDEO_STREAM_INFORMATION_DATA {
31174 fn default() -> Self {
31175 Self::DEFAULT.clone()
31176 }
31177}
31178impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
31179 type Message = MavMessage;
31180 const ID: u32 = 269u32;
31181 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
31182 const EXTRA_CRC: u8 = 109u8;
31183 const ENCODED_LEN: usize = 215usize;
31184 fn deser(
31185 _version: MavlinkVersion,
31186 __input: &[u8],
31187 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31188 let avail_len = __input.len();
31189 let mut payload_buf = [0; Self::ENCODED_LEN];
31190 let mut buf = if avail_len < Self::ENCODED_LEN {
31191 payload_buf[0..avail_len].copy_from_slice(__input);
31192 Bytes::new(&payload_buf)
31193 } else {
31194 Bytes::new(__input)
31195 };
31196 let mut __struct = Self::default();
31197 __struct.framerate = buf.get_f32_le();
31198 __struct.bitrate = buf.get_u32_le();
31199 let tmp = buf.get_u16_le();
31200 __struct.flags = VideoStreamStatusFlags::from_bits(
31201 tmp & VideoStreamStatusFlags::all().bits(),
31202 )
31203 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31204 flag_type: "VideoStreamStatusFlags",
31205 value: tmp as u32,
31206 })?;
31207 __struct.resolution_h = buf.get_u16_le();
31208 __struct.resolution_v = buf.get_u16_le();
31209 __struct.rotation = buf.get_u16_le();
31210 __struct.hfov = buf.get_u16_le();
31211 __struct.stream_id = buf.get_u8();
31212 __struct.count = buf.get_u8();
31213 let tmp = buf.get_u8();
31214 __struct.mavtype =
31215 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31216 enum_type: "VideoStreamType",
31217 value: tmp as u32,
31218 })?;
31219 for v in &mut __struct.name {
31220 let val = buf.get_u8();
31221 *v = val;
31222 }
31223 for v in &mut __struct.uri {
31224 let val = buf.get_u8();
31225 *v = val;
31226 }
31227 let tmp = buf.get_u8();
31228 __struct.encoding =
31229 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31230 enum_type: "VideoStreamEncoding",
31231 value: tmp as u32,
31232 })?;
31233 __struct.camera_device_id = buf.get_u8();
31234 Ok(__struct)
31235 }
31236 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31237 let mut __tmp = BytesMut::new(bytes);
31238 #[allow(clippy::absurd_extreme_comparisons)]
31239 #[allow(unused_comparisons)]
31240 if __tmp.remaining() < Self::ENCODED_LEN {
31241 panic!(
31242 "buffer is too small (need {} bytes, but got {})",
31243 Self::ENCODED_LEN,
31244 __tmp.remaining(),
31245 )
31246 }
31247 __tmp.put_f32_le(self.framerate);
31248 __tmp.put_u32_le(self.bitrate);
31249 __tmp.put_u16_le(self.flags.bits());
31250 __tmp.put_u16_le(self.resolution_h);
31251 __tmp.put_u16_le(self.resolution_v);
31252 __tmp.put_u16_le(self.rotation);
31253 __tmp.put_u16_le(self.hfov);
31254 __tmp.put_u8(self.stream_id);
31255 __tmp.put_u8(self.count);
31256 __tmp.put_u8(self.mavtype as u8);
31257 for val in &self.name {
31258 __tmp.put_u8(*val);
31259 }
31260 for val in &self.uri {
31261 __tmp.put_u8(*val);
31262 }
31263 __tmp.put_u8(self.encoding as u8);
31264 __tmp.put_u8(self.camera_device_id);
31265 if matches!(version, MavlinkVersion::V2) {
31266 let len = __tmp.len();
31267 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31268 } else {
31269 __tmp.len()
31270 }
31271 }
31272}
31273#[doc = "id: 270"]
31274#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
31275#[derive(Debug, Clone, PartialEq)]
31276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31277#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31278pub struct VIDEO_STREAM_STATUS_DATA {
31279 #[doc = "Frame rate"]
31280 pub framerate: f32,
31281 #[doc = "Bit rate"]
31282 pub bitrate: u32,
31283 #[doc = "Bitmap of stream status flags"]
31284 pub flags: VideoStreamStatusFlags,
31285 #[doc = "Horizontal resolution"]
31286 pub resolution_h: u16,
31287 #[doc = "Vertical resolution"]
31288 pub resolution_v: u16,
31289 #[doc = "Video image rotation clockwise"]
31290 pub rotation: u16,
31291 #[doc = "Horizontal Field of view"]
31292 pub hfov: u16,
31293 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
31294 pub stream_id: u8,
31295 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
31296 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31297 pub camera_device_id: u8,
31298}
31299impl VIDEO_STREAM_STATUS_DATA {
31300 pub const ENCODED_LEN: usize = 20usize;
31301 pub const DEFAULT: Self = Self {
31302 framerate: 0.0_f32,
31303 bitrate: 0_u32,
31304 flags: VideoStreamStatusFlags::DEFAULT,
31305 resolution_h: 0_u16,
31306 resolution_v: 0_u16,
31307 rotation: 0_u16,
31308 hfov: 0_u16,
31309 stream_id: 0_u8,
31310 camera_device_id: 0_u8,
31311 };
31312 #[cfg(feature = "arbitrary")]
31313 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31314 use arbitrary::{Arbitrary, Unstructured};
31315 let mut buf = [0u8; 1024];
31316 rng.fill_bytes(&mut buf);
31317 let mut unstructured = Unstructured::new(&buf);
31318 Self::arbitrary(&mut unstructured).unwrap_or_default()
31319 }
31320}
31321impl Default for VIDEO_STREAM_STATUS_DATA {
31322 fn default() -> Self {
31323 Self::DEFAULT.clone()
31324 }
31325}
31326impl MessageData for VIDEO_STREAM_STATUS_DATA {
31327 type Message = MavMessage;
31328 const ID: u32 = 270u32;
31329 const NAME: &'static str = "VIDEO_STREAM_STATUS";
31330 const EXTRA_CRC: u8 = 59u8;
31331 const ENCODED_LEN: usize = 20usize;
31332 fn deser(
31333 _version: MavlinkVersion,
31334 __input: &[u8],
31335 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31336 let avail_len = __input.len();
31337 let mut payload_buf = [0; Self::ENCODED_LEN];
31338 let mut buf = if avail_len < Self::ENCODED_LEN {
31339 payload_buf[0..avail_len].copy_from_slice(__input);
31340 Bytes::new(&payload_buf)
31341 } else {
31342 Bytes::new(__input)
31343 };
31344 let mut __struct = Self::default();
31345 __struct.framerate = buf.get_f32_le();
31346 __struct.bitrate = buf.get_u32_le();
31347 let tmp = buf.get_u16_le();
31348 __struct.flags = VideoStreamStatusFlags::from_bits(
31349 tmp & VideoStreamStatusFlags::all().bits(),
31350 )
31351 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31352 flag_type: "VideoStreamStatusFlags",
31353 value: tmp as u32,
31354 })?;
31355 __struct.resolution_h = buf.get_u16_le();
31356 __struct.resolution_v = buf.get_u16_le();
31357 __struct.rotation = buf.get_u16_le();
31358 __struct.hfov = buf.get_u16_le();
31359 __struct.stream_id = buf.get_u8();
31360 __struct.camera_device_id = buf.get_u8();
31361 Ok(__struct)
31362 }
31363 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31364 let mut __tmp = BytesMut::new(bytes);
31365 #[allow(clippy::absurd_extreme_comparisons)]
31366 #[allow(unused_comparisons)]
31367 if __tmp.remaining() < Self::ENCODED_LEN {
31368 panic!(
31369 "buffer is too small (need {} bytes, but got {})",
31370 Self::ENCODED_LEN,
31371 __tmp.remaining(),
31372 )
31373 }
31374 __tmp.put_f32_le(self.framerate);
31375 __tmp.put_u32_le(self.bitrate);
31376 __tmp.put_u16_le(self.flags.bits());
31377 __tmp.put_u16_le(self.resolution_h);
31378 __tmp.put_u16_le(self.resolution_v);
31379 __tmp.put_u16_le(self.rotation);
31380 __tmp.put_u16_le(self.hfov);
31381 __tmp.put_u8(self.stream_id);
31382 __tmp.put_u8(self.camera_device_id);
31383 if matches!(version, MavlinkVersion::V2) {
31384 let len = __tmp.len();
31385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31386 } else {
31387 __tmp.len()
31388 }
31389 }
31390}
31391#[doc = "id: 102"]
31392#[doc = "Local position/attitude estimate from a vision source."]
31393#[derive(Debug, Clone, PartialEq)]
31394#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31395#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31396pub struct VISION_POSITION_ESTIMATE_DATA {
31397 #[doc = "Timestamp (UNIX time or time since system boot)"]
31398 pub usec: u64,
31399 #[doc = "Local X position"]
31400 pub x: f32,
31401 #[doc = "Local Y position"]
31402 pub y: f32,
31403 #[doc = "Local Z position"]
31404 pub z: f32,
31405 #[doc = "Roll angle"]
31406 pub roll: f32,
31407 #[doc = "Pitch angle"]
31408 pub pitch: f32,
31409 #[doc = "Yaw angle"]
31410 pub yaw: f32,
31411 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31412 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31413 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31414 pub covariance: [f32; 21],
31415 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31416 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31417 pub reset_counter: u8,
31418}
31419impl VISION_POSITION_ESTIMATE_DATA {
31420 pub const ENCODED_LEN: usize = 117usize;
31421 pub const DEFAULT: Self = Self {
31422 usec: 0_u64,
31423 x: 0.0_f32,
31424 y: 0.0_f32,
31425 z: 0.0_f32,
31426 roll: 0.0_f32,
31427 pitch: 0.0_f32,
31428 yaw: 0.0_f32,
31429 covariance: [0.0_f32; 21usize],
31430 reset_counter: 0_u8,
31431 };
31432 #[cfg(feature = "arbitrary")]
31433 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31434 use arbitrary::{Arbitrary, Unstructured};
31435 let mut buf = [0u8; 1024];
31436 rng.fill_bytes(&mut buf);
31437 let mut unstructured = Unstructured::new(&buf);
31438 Self::arbitrary(&mut unstructured).unwrap_or_default()
31439 }
31440}
31441impl Default for VISION_POSITION_ESTIMATE_DATA {
31442 fn default() -> Self {
31443 Self::DEFAULT.clone()
31444 }
31445}
31446impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31447 type Message = MavMessage;
31448 const ID: u32 = 102u32;
31449 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31450 const EXTRA_CRC: u8 = 158u8;
31451 const ENCODED_LEN: usize = 117usize;
31452 fn deser(
31453 _version: MavlinkVersion,
31454 __input: &[u8],
31455 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31456 let avail_len = __input.len();
31457 let mut payload_buf = [0; Self::ENCODED_LEN];
31458 let mut buf = if avail_len < Self::ENCODED_LEN {
31459 payload_buf[0..avail_len].copy_from_slice(__input);
31460 Bytes::new(&payload_buf)
31461 } else {
31462 Bytes::new(__input)
31463 };
31464 let mut __struct = Self::default();
31465 __struct.usec = buf.get_u64_le();
31466 __struct.x = buf.get_f32_le();
31467 __struct.y = buf.get_f32_le();
31468 __struct.z = buf.get_f32_le();
31469 __struct.roll = buf.get_f32_le();
31470 __struct.pitch = buf.get_f32_le();
31471 __struct.yaw = buf.get_f32_le();
31472 for v in &mut __struct.covariance {
31473 let val = buf.get_f32_le();
31474 *v = val;
31475 }
31476 __struct.reset_counter = buf.get_u8();
31477 Ok(__struct)
31478 }
31479 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31480 let mut __tmp = BytesMut::new(bytes);
31481 #[allow(clippy::absurd_extreme_comparisons)]
31482 #[allow(unused_comparisons)]
31483 if __tmp.remaining() < Self::ENCODED_LEN {
31484 panic!(
31485 "buffer is too small (need {} bytes, but got {})",
31486 Self::ENCODED_LEN,
31487 __tmp.remaining(),
31488 )
31489 }
31490 __tmp.put_u64_le(self.usec);
31491 __tmp.put_f32_le(self.x);
31492 __tmp.put_f32_le(self.y);
31493 __tmp.put_f32_le(self.z);
31494 __tmp.put_f32_le(self.roll);
31495 __tmp.put_f32_le(self.pitch);
31496 __tmp.put_f32_le(self.yaw);
31497 for val in &self.covariance {
31498 __tmp.put_f32_le(*val);
31499 }
31500 __tmp.put_u8(self.reset_counter);
31501 if matches!(version, MavlinkVersion::V2) {
31502 let len = __tmp.len();
31503 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31504 } else {
31505 __tmp.len()
31506 }
31507 }
31508}
31509#[doc = "id: 103"]
31510#[doc = "Speed estimate from a vision source."]
31511#[derive(Debug, Clone, PartialEq)]
31512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31514pub struct VISION_SPEED_ESTIMATE_DATA {
31515 #[doc = "Timestamp (UNIX time or time since system boot)"]
31516 pub usec: u64,
31517 #[doc = "Global X speed"]
31518 pub x: f32,
31519 #[doc = "Global Y speed"]
31520 pub y: f32,
31521 #[doc = "Global Z speed"]
31522 pub z: f32,
31523 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31524 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31526 pub covariance: [f32; 9],
31527 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31528 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31529 pub reset_counter: u8,
31530}
31531impl VISION_SPEED_ESTIMATE_DATA {
31532 pub const ENCODED_LEN: usize = 57usize;
31533 pub const DEFAULT: Self = Self {
31534 usec: 0_u64,
31535 x: 0.0_f32,
31536 y: 0.0_f32,
31537 z: 0.0_f32,
31538 covariance: [0.0_f32; 9usize],
31539 reset_counter: 0_u8,
31540 };
31541 #[cfg(feature = "arbitrary")]
31542 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31543 use arbitrary::{Arbitrary, Unstructured};
31544 let mut buf = [0u8; 1024];
31545 rng.fill_bytes(&mut buf);
31546 let mut unstructured = Unstructured::new(&buf);
31547 Self::arbitrary(&mut unstructured).unwrap_or_default()
31548 }
31549}
31550impl Default for VISION_SPEED_ESTIMATE_DATA {
31551 fn default() -> Self {
31552 Self::DEFAULT.clone()
31553 }
31554}
31555impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31556 type Message = MavMessage;
31557 const ID: u32 = 103u32;
31558 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31559 const EXTRA_CRC: u8 = 208u8;
31560 const ENCODED_LEN: usize = 57usize;
31561 fn deser(
31562 _version: MavlinkVersion,
31563 __input: &[u8],
31564 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31565 let avail_len = __input.len();
31566 let mut payload_buf = [0; Self::ENCODED_LEN];
31567 let mut buf = if avail_len < Self::ENCODED_LEN {
31568 payload_buf[0..avail_len].copy_from_slice(__input);
31569 Bytes::new(&payload_buf)
31570 } else {
31571 Bytes::new(__input)
31572 };
31573 let mut __struct = Self::default();
31574 __struct.usec = buf.get_u64_le();
31575 __struct.x = buf.get_f32_le();
31576 __struct.y = buf.get_f32_le();
31577 __struct.z = buf.get_f32_le();
31578 for v in &mut __struct.covariance {
31579 let val = buf.get_f32_le();
31580 *v = val;
31581 }
31582 __struct.reset_counter = buf.get_u8();
31583 Ok(__struct)
31584 }
31585 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31586 let mut __tmp = BytesMut::new(bytes);
31587 #[allow(clippy::absurd_extreme_comparisons)]
31588 #[allow(unused_comparisons)]
31589 if __tmp.remaining() < Self::ENCODED_LEN {
31590 panic!(
31591 "buffer is too small (need {} bytes, but got {})",
31592 Self::ENCODED_LEN,
31593 __tmp.remaining(),
31594 )
31595 }
31596 __tmp.put_u64_le(self.usec);
31597 __tmp.put_f32_le(self.x);
31598 __tmp.put_f32_le(self.y);
31599 __tmp.put_f32_le(self.z);
31600 for val in &self.covariance {
31601 __tmp.put_f32_le(*val);
31602 }
31603 __tmp.put_u8(self.reset_counter);
31604 if matches!(version, MavlinkVersion::V2) {
31605 let len = __tmp.len();
31606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31607 } else {
31608 __tmp.len()
31609 }
31610 }
31611}
31612#[doc = "id: 9000"]
31613#[doc = "Cumulative distance traveled for each reported wheel."]
31614#[derive(Debug, Clone, PartialEq)]
31615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31617pub struct WHEEL_DISTANCE_DATA {
31618 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31619 pub time_usec: u64,
31620 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31621 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31622 pub distance: [f64; 16],
31623 #[doc = "Number of wheels reported."]
31624 pub count: u8,
31625}
31626impl WHEEL_DISTANCE_DATA {
31627 pub const ENCODED_LEN: usize = 137usize;
31628 pub const DEFAULT: Self = Self {
31629 time_usec: 0_u64,
31630 distance: [0.0_f64; 16usize],
31631 count: 0_u8,
31632 };
31633 #[cfg(feature = "arbitrary")]
31634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31635 use arbitrary::{Arbitrary, Unstructured};
31636 let mut buf = [0u8; 1024];
31637 rng.fill_bytes(&mut buf);
31638 let mut unstructured = Unstructured::new(&buf);
31639 Self::arbitrary(&mut unstructured).unwrap_or_default()
31640 }
31641}
31642impl Default for WHEEL_DISTANCE_DATA {
31643 fn default() -> Self {
31644 Self::DEFAULT.clone()
31645 }
31646}
31647impl MessageData for WHEEL_DISTANCE_DATA {
31648 type Message = MavMessage;
31649 const ID: u32 = 9000u32;
31650 const NAME: &'static str = "WHEEL_DISTANCE";
31651 const EXTRA_CRC: u8 = 113u8;
31652 const ENCODED_LEN: usize = 137usize;
31653 fn deser(
31654 _version: MavlinkVersion,
31655 __input: &[u8],
31656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31657 let avail_len = __input.len();
31658 let mut payload_buf = [0; Self::ENCODED_LEN];
31659 let mut buf = if avail_len < Self::ENCODED_LEN {
31660 payload_buf[0..avail_len].copy_from_slice(__input);
31661 Bytes::new(&payload_buf)
31662 } else {
31663 Bytes::new(__input)
31664 };
31665 let mut __struct = Self::default();
31666 __struct.time_usec = buf.get_u64_le();
31667 for v in &mut __struct.distance {
31668 let val = buf.get_f64_le();
31669 *v = val;
31670 }
31671 __struct.count = buf.get_u8();
31672 Ok(__struct)
31673 }
31674 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31675 let mut __tmp = BytesMut::new(bytes);
31676 #[allow(clippy::absurd_extreme_comparisons)]
31677 #[allow(unused_comparisons)]
31678 if __tmp.remaining() < Self::ENCODED_LEN {
31679 panic!(
31680 "buffer is too small (need {} bytes, but got {})",
31681 Self::ENCODED_LEN,
31682 __tmp.remaining(),
31683 )
31684 }
31685 __tmp.put_u64_le(self.time_usec);
31686 for val in &self.distance {
31687 __tmp.put_f64_le(*val);
31688 }
31689 __tmp.put_u8(self.count);
31690 if matches!(version, MavlinkVersion::V2) {
31691 let len = __tmp.len();
31692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31693 } else {
31694 __tmp.len()
31695 }
31696 }
31697}
31698#[doc = "id: 299"]
31699#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31700#[derive(Debug, Clone, PartialEq)]
31701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31703pub struct WIFI_CONFIG_AP_DATA {
31704 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31705 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31706 pub ssid: [u8; 32],
31707 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31709 pub password: [u8; 64],
31710 #[doc = "WiFi Mode."]
31711 #[cfg_attr(feature = "serde", serde(default))]
31712 pub mode: WifiConfigApMode,
31713 #[doc = "Message acceptance response (sent back to GS)."]
31714 #[cfg_attr(feature = "serde", serde(default))]
31715 pub response: WifiConfigApResponse,
31716}
31717impl WIFI_CONFIG_AP_DATA {
31718 pub const ENCODED_LEN: usize = 98usize;
31719 pub const DEFAULT: Self = Self {
31720 ssid: [0_u8; 32usize],
31721 password: [0_u8; 64usize],
31722 mode: WifiConfigApMode::DEFAULT,
31723 response: WifiConfigApResponse::DEFAULT,
31724 };
31725 #[cfg(feature = "arbitrary")]
31726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31727 use arbitrary::{Arbitrary, Unstructured};
31728 let mut buf = [0u8; 1024];
31729 rng.fill_bytes(&mut buf);
31730 let mut unstructured = Unstructured::new(&buf);
31731 Self::arbitrary(&mut unstructured).unwrap_or_default()
31732 }
31733}
31734impl Default for WIFI_CONFIG_AP_DATA {
31735 fn default() -> Self {
31736 Self::DEFAULT.clone()
31737 }
31738}
31739impl MessageData for WIFI_CONFIG_AP_DATA {
31740 type Message = MavMessage;
31741 const ID: u32 = 299u32;
31742 const NAME: &'static str = "WIFI_CONFIG_AP";
31743 const EXTRA_CRC: u8 = 19u8;
31744 const ENCODED_LEN: usize = 98usize;
31745 fn deser(
31746 _version: MavlinkVersion,
31747 __input: &[u8],
31748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31749 let avail_len = __input.len();
31750 let mut payload_buf = [0; Self::ENCODED_LEN];
31751 let mut buf = if avail_len < Self::ENCODED_LEN {
31752 payload_buf[0..avail_len].copy_from_slice(__input);
31753 Bytes::new(&payload_buf)
31754 } else {
31755 Bytes::new(__input)
31756 };
31757 let mut __struct = Self::default();
31758 for v in &mut __struct.ssid {
31759 let val = buf.get_u8();
31760 *v = val;
31761 }
31762 for v in &mut __struct.password {
31763 let val = buf.get_u8();
31764 *v = val;
31765 }
31766 let tmp = buf.get_i8();
31767 __struct.mode =
31768 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31769 enum_type: "WifiConfigApMode",
31770 value: tmp as u32,
31771 })?;
31772 let tmp = buf.get_i8();
31773 __struct.response =
31774 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31775 enum_type: "WifiConfigApResponse",
31776 value: tmp as u32,
31777 })?;
31778 Ok(__struct)
31779 }
31780 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31781 let mut __tmp = BytesMut::new(bytes);
31782 #[allow(clippy::absurd_extreme_comparisons)]
31783 #[allow(unused_comparisons)]
31784 if __tmp.remaining() < Self::ENCODED_LEN {
31785 panic!(
31786 "buffer is too small (need {} bytes, but got {})",
31787 Self::ENCODED_LEN,
31788 __tmp.remaining(),
31789 )
31790 }
31791 for val in &self.ssid {
31792 __tmp.put_u8(*val);
31793 }
31794 for val in &self.password {
31795 __tmp.put_u8(*val);
31796 }
31797 __tmp.put_i8(self.mode as i8);
31798 __tmp.put_i8(self.response as i8);
31799 if matches!(version, MavlinkVersion::V2) {
31800 let len = __tmp.len();
31801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31802 } else {
31803 __tmp.len()
31804 }
31805 }
31806}
31807#[doc = "id: 9005"]
31808#[doc = "Winch status."]
31809#[derive(Debug, Clone, PartialEq)]
31810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31812pub struct WINCH_STATUS_DATA {
31813 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31814 pub time_usec: u64,
31815 #[doc = "Length of line released. NaN if unknown"]
31816 pub line_length: f32,
31817 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31818 pub speed: f32,
31819 #[doc = "Tension on the line. NaN if unknown"]
31820 pub tension: f32,
31821 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31822 pub voltage: f32,
31823 #[doc = "Current draw from the winch. NaN if unknown"]
31824 pub current: f32,
31825 #[doc = "Status flags"]
31826 pub status: MavWinchStatusFlag,
31827 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31828 pub temperature: i16,
31829}
31830impl WINCH_STATUS_DATA {
31831 pub const ENCODED_LEN: usize = 34usize;
31832 pub const DEFAULT: Self = Self {
31833 time_usec: 0_u64,
31834 line_length: 0.0_f32,
31835 speed: 0.0_f32,
31836 tension: 0.0_f32,
31837 voltage: 0.0_f32,
31838 current: 0.0_f32,
31839 status: MavWinchStatusFlag::DEFAULT,
31840 temperature: 0_i16,
31841 };
31842 #[cfg(feature = "arbitrary")]
31843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31844 use arbitrary::{Arbitrary, Unstructured};
31845 let mut buf = [0u8; 1024];
31846 rng.fill_bytes(&mut buf);
31847 let mut unstructured = Unstructured::new(&buf);
31848 Self::arbitrary(&mut unstructured).unwrap_or_default()
31849 }
31850}
31851impl Default for WINCH_STATUS_DATA {
31852 fn default() -> Self {
31853 Self::DEFAULT.clone()
31854 }
31855}
31856impl MessageData for WINCH_STATUS_DATA {
31857 type Message = MavMessage;
31858 const ID: u32 = 9005u32;
31859 const NAME: &'static str = "WINCH_STATUS";
31860 const EXTRA_CRC: u8 = 117u8;
31861 const ENCODED_LEN: usize = 34usize;
31862 fn deser(
31863 _version: MavlinkVersion,
31864 __input: &[u8],
31865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31866 let avail_len = __input.len();
31867 let mut payload_buf = [0; Self::ENCODED_LEN];
31868 let mut buf = if avail_len < Self::ENCODED_LEN {
31869 payload_buf[0..avail_len].copy_from_slice(__input);
31870 Bytes::new(&payload_buf)
31871 } else {
31872 Bytes::new(__input)
31873 };
31874 let mut __struct = Self::default();
31875 __struct.time_usec = buf.get_u64_le();
31876 __struct.line_length = buf.get_f32_le();
31877 __struct.speed = buf.get_f32_le();
31878 __struct.tension = buf.get_f32_le();
31879 __struct.voltage = buf.get_f32_le();
31880 __struct.current = buf.get_f32_le();
31881 let tmp = buf.get_u32_le();
31882 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31883 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31884 flag_type: "MavWinchStatusFlag",
31885 value: tmp as u32,
31886 })?;
31887 __struct.temperature = buf.get_i16_le();
31888 Ok(__struct)
31889 }
31890 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31891 let mut __tmp = BytesMut::new(bytes);
31892 #[allow(clippy::absurd_extreme_comparisons)]
31893 #[allow(unused_comparisons)]
31894 if __tmp.remaining() < Self::ENCODED_LEN {
31895 panic!(
31896 "buffer is too small (need {} bytes, but got {})",
31897 Self::ENCODED_LEN,
31898 __tmp.remaining(),
31899 )
31900 }
31901 __tmp.put_u64_le(self.time_usec);
31902 __tmp.put_f32_le(self.line_length);
31903 __tmp.put_f32_le(self.speed);
31904 __tmp.put_f32_le(self.tension);
31905 __tmp.put_f32_le(self.voltage);
31906 __tmp.put_f32_le(self.current);
31907 __tmp.put_u32_le(self.status.bits());
31908 __tmp.put_i16_le(self.temperature);
31909 if matches!(version, MavlinkVersion::V2) {
31910 let len = __tmp.len();
31911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31912 } else {
31913 __tmp.len()
31914 }
31915 }
31916}
31917#[doc = "id: 231"]
31918#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31919#[derive(Debug, Clone, PartialEq)]
31920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31922pub struct WIND_COV_DATA {
31923 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31924 pub time_usec: u64,
31925 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31926 pub wind_x: f32,
31927 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31928 pub wind_y: f32,
31929 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31930 pub wind_z: f32,
31931 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31932 pub var_horiz: f32,
31933 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31934 pub var_vert: f32,
31935 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31936 pub wind_alt: f32,
31937 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31938 pub horiz_accuracy: f32,
31939 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31940 pub vert_accuracy: f32,
31941}
31942impl WIND_COV_DATA {
31943 pub const ENCODED_LEN: usize = 40usize;
31944 pub const DEFAULT: Self = Self {
31945 time_usec: 0_u64,
31946 wind_x: 0.0_f32,
31947 wind_y: 0.0_f32,
31948 wind_z: 0.0_f32,
31949 var_horiz: 0.0_f32,
31950 var_vert: 0.0_f32,
31951 wind_alt: 0.0_f32,
31952 horiz_accuracy: 0.0_f32,
31953 vert_accuracy: 0.0_f32,
31954 };
31955 #[cfg(feature = "arbitrary")]
31956 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31957 use arbitrary::{Arbitrary, Unstructured};
31958 let mut buf = [0u8; 1024];
31959 rng.fill_bytes(&mut buf);
31960 let mut unstructured = Unstructured::new(&buf);
31961 Self::arbitrary(&mut unstructured).unwrap_or_default()
31962 }
31963}
31964impl Default for WIND_COV_DATA {
31965 fn default() -> Self {
31966 Self::DEFAULT.clone()
31967 }
31968}
31969impl MessageData for WIND_COV_DATA {
31970 type Message = MavMessage;
31971 const ID: u32 = 231u32;
31972 const NAME: &'static str = "WIND_COV";
31973 const EXTRA_CRC: u8 = 105u8;
31974 const ENCODED_LEN: usize = 40usize;
31975 fn deser(
31976 _version: MavlinkVersion,
31977 __input: &[u8],
31978 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31979 let avail_len = __input.len();
31980 let mut payload_buf = [0; Self::ENCODED_LEN];
31981 let mut buf = if avail_len < Self::ENCODED_LEN {
31982 payload_buf[0..avail_len].copy_from_slice(__input);
31983 Bytes::new(&payload_buf)
31984 } else {
31985 Bytes::new(__input)
31986 };
31987 let mut __struct = Self::default();
31988 __struct.time_usec = buf.get_u64_le();
31989 __struct.wind_x = buf.get_f32_le();
31990 __struct.wind_y = buf.get_f32_le();
31991 __struct.wind_z = buf.get_f32_le();
31992 __struct.var_horiz = buf.get_f32_le();
31993 __struct.var_vert = buf.get_f32_le();
31994 __struct.wind_alt = buf.get_f32_le();
31995 __struct.horiz_accuracy = buf.get_f32_le();
31996 __struct.vert_accuracy = buf.get_f32_le();
31997 Ok(__struct)
31998 }
31999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32000 let mut __tmp = BytesMut::new(bytes);
32001 #[allow(clippy::absurd_extreme_comparisons)]
32002 #[allow(unused_comparisons)]
32003 if __tmp.remaining() < Self::ENCODED_LEN {
32004 panic!(
32005 "buffer is too small (need {} bytes, but got {})",
32006 Self::ENCODED_LEN,
32007 __tmp.remaining(),
32008 )
32009 }
32010 __tmp.put_u64_le(self.time_usec);
32011 __tmp.put_f32_le(self.wind_x);
32012 __tmp.put_f32_le(self.wind_y);
32013 __tmp.put_f32_le(self.wind_z);
32014 __tmp.put_f32_le(self.var_horiz);
32015 __tmp.put_f32_le(self.var_vert);
32016 __tmp.put_f32_le(self.wind_alt);
32017 __tmp.put_f32_le(self.horiz_accuracy);
32018 __tmp.put_f32_le(self.vert_accuracy);
32019 if matches!(version, MavlinkVersion::V2) {
32020 let len = __tmp.len();
32021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32022 } else {
32023 __tmp.len()
32024 }
32025 }
32026}
32027#[derive(Clone, PartialEq, Debug)]
32028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32029#[cfg_attr(feature = "serde", serde(tag = "type"))]
32030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32031#[repr(u32)]
32032pub enum MavMessage {
32033 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
32034 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
32035 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
32036 AIS_VESSEL(AIS_VESSEL_DATA),
32037 ALTITUDE(ALTITUDE_DATA),
32038 ATTITUDE(ATTITUDE_DATA),
32039 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
32040 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
32041 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
32042 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
32043 AUTH_KEY(AUTH_KEY_DATA),
32044 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
32045 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
32046 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
32047 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
32048 BATTERY_INFO(BATTERY_INFO_DATA),
32049 BATTERY_STATUS(BATTERY_STATUS_DATA),
32050 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
32051 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
32052 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
32053 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
32054 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
32055 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
32056 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
32057 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
32058 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
32059 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
32060 CANFD_FRAME(CANFD_FRAME_DATA),
32061 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
32062 CAN_FRAME(CAN_FRAME_DATA),
32063 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
32064 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
32065 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
32066 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
32067 COLLISION(COLLISION_DATA),
32068 COMMAND_ACK(COMMAND_ACK_DATA),
32069 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
32070 COMMAND_INT(COMMAND_INT_DATA),
32071 COMMAND_LONG(COMMAND_LONG_DATA),
32072 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
32073 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
32074 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
32075 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
32076 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
32077 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
32078 CURRENT_MODE(CURRENT_MODE_DATA),
32079 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
32080 DATA_STREAM(DATA_STREAM_DATA),
32081 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
32082 DEBUG(DEBUG_DATA),
32083 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
32084 DEBUG_VECT(DEBUG_VECT_DATA),
32085 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
32086 EFI_STATUS(EFI_STATUS_DATA),
32087 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
32088 ESC_INFO(ESC_INFO_DATA),
32089 ESC_STATUS(ESC_STATUS_DATA),
32090 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
32091 EVENT(EVENT_DATA),
32092 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
32093 FENCE_STATUS(FENCE_STATUS_DATA),
32094 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
32095 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
32096 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
32097 FUEL_STATUS(FUEL_STATUS_DATA),
32098 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
32099 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
32100 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
32101 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
32102 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
32103 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
32104 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
32105 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32106 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32107 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32108 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32109 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32110 GPS2_RAW(GPS2_RAW_DATA),
32111 GPS2_RTK(GPS2_RTK_DATA),
32112 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32113 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32114 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32115 GPS_INPUT(GPS_INPUT_DATA),
32116 GPS_RAW_INT(GPS_RAW_INT_DATA),
32117 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32118 GPS_RTK(GPS_RTK_DATA),
32119 GPS_STATUS(GPS_STATUS_DATA),
32120 HEARTBEAT(HEARTBEAT_DATA),
32121 HIGHRES_IMU(HIGHRES_IMU_DATA),
32122 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32123 HIGH_LATENCY(HIGH_LATENCY_DATA),
32124 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32125 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32126 HIL_CONTROLS(HIL_CONTROLS_DATA),
32127 HIL_GPS(HIL_GPS_DATA),
32128 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32129 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32130 HIL_SENSOR(HIL_SENSOR_DATA),
32131 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32132 HIL_STATE(HIL_STATE_DATA),
32133 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32134 HOME_POSITION(HOME_POSITION_DATA),
32135 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32136 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32137 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32138 LANDING_TARGET(LANDING_TARGET_DATA),
32139 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32140 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32141 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32142 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32143 LOGGING_ACK(LOGGING_ACK_DATA),
32144 LOGGING_DATA(LOGGING_DATA_DATA),
32145 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32146 LOG_DATA(LOG_DATA_DATA),
32147 LOG_ENTRY(LOG_ENTRY_DATA),
32148 LOG_ERASE(LOG_ERASE_DATA),
32149 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32150 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32151 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32152 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32153 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32154 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32155 MEMORY_VECT(MEMORY_VECT_DATA),
32156 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32157 MISSION_ACK(MISSION_ACK_DATA),
32158 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32159 MISSION_COUNT(MISSION_COUNT_DATA),
32160 MISSION_CURRENT(MISSION_CURRENT_DATA),
32161 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32162 MISSION_ITEM(MISSION_ITEM_DATA),
32163 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32164 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32165 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32166 MISSION_REQUEST(MISSION_REQUEST_DATA),
32167 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32168 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32169 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32170 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32171 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32172 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32173 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32174 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32175 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32176 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32177 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32178 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32179 ODOMETRY(ODOMETRY_DATA),
32180 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32181 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32182 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32183 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32184 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32185 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32186 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32187 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32188 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32189 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32190 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32191 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32192 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32193 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32194 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32195 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32196 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32197 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32198 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32199 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32200 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32201 PARAM_SET(PARAM_SET_DATA),
32202 PARAM_VALUE(PARAM_VALUE_DATA),
32203 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32204 PING(PING_DATA),
32205 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32206 PLAY_TUNE(PLAY_TUNE_DATA),
32207 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32208 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32209 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32210 POWER_STATUS(POWER_STATUS_DATA),
32211 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32212 RADIO_STATUS(RADIO_STATUS_DATA),
32213 RAW_IMU(RAW_IMU_DATA),
32214 RAW_PRESSURE(RAW_PRESSURE_DATA),
32215 RAW_RPM(RAW_RPM_DATA),
32216 RC_CHANNELS(RC_CHANNELS_DATA),
32217 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32218 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32219 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32220 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32221 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32222 REQUEST_EVENT(REQUEST_EVENT_DATA),
32223 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32224 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32225 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32226 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32227 SCALED_IMU(SCALED_IMU_DATA),
32228 SCALED_IMU2(SCALED_IMU2_DATA),
32229 SCALED_IMU3(SCALED_IMU3_DATA),
32230 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32231 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32232 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32233 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32234 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32235 SETUP_SIGNING(SETUP_SIGNING_DATA),
32236 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32237 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32238 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32239 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32240 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32241 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32242 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32243 SET_MODE(SET_MODE_DATA),
32244 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32245 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32246 SIM_STATE(SIM_STATE_DATA),
32247 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32248 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32249 STATUSTEXT(STATUSTEXT_DATA),
32250 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32251 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32252 SYSTEM_TIME(SYSTEM_TIME_DATA),
32253 SYS_STATUS(SYS_STATUS_DATA),
32254 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32255 TERRAIN_DATA(TERRAIN_DATA_DATA),
32256 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32257 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32258 TIMESYNC(TIMESYNC_DATA),
32259 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32260 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32261 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32262 TUNNEL(TUNNEL_DATA),
32263 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32264 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32265 UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA),
32266 UAVIONIX_ADSB_OUT_CFG(UAVIONIX_ADSB_OUT_CFG_DATA),
32267 UAVIONIX_ADSB_OUT_CFG_FLIGHTID(UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA),
32268 UAVIONIX_ADSB_OUT_CFG_REGISTRATION(UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA),
32269 UAVIONIX_ADSB_OUT_CONTROL(UAVIONIX_ADSB_OUT_CONTROL_DATA),
32270 UAVIONIX_ADSB_OUT_DYNAMIC(UAVIONIX_ADSB_OUT_DYNAMIC_DATA),
32271 UAVIONIX_ADSB_OUT_STATUS(UAVIONIX_ADSB_OUT_STATUS_DATA),
32272 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA),
32273 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32274 V2_EXTENSION(V2_EXTENSION_DATA),
32275 VFR_HUD(VFR_HUD_DATA),
32276 VIBRATION(VIBRATION_DATA),
32277 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32278 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32279 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32280 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32281 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
32282 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
32283 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
32284 WINCH_STATUS(WINCH_STATUS_DATA),
32285 WIND_COV(WIND_COV_DATA),
32286}
32287impl MavMessage {
32288 pub const fn all_ids() -> &'static [u32] {
32289 &[
32290 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
32291 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
32292 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
32293 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
32294 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
32295 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
32296 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
32297 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
32298 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
32299 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
32300 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
32301 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
32302 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
32303 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
32304 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
32305 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
32306 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
32307 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
32308 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
32309 440u32, 9000u32, 9005u32, 10001u32, 10002u32, 10003u32, 10004u32, 10005u32, 10006u32,
32310 10007u32, 10008u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
32311 12915u32, 12918u32, 12919u32, 12920u32,
32312 ]
32313 }
32314}
32315impl Message for MavMessage {
32316 fn parse(
32317 version: MavlinkVersion,
32318 id: u32,
32319 payload: &[u8],
32320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32321 match id {
32322 ACTUATOR_CONTROL_TARGET_DATA::ID => {
32323 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32324 .map(Self::ACTUATOR_CONTROL_TARGET)
32325 }
32326 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
32327 .map(Self::ACTUATOR_OUTPUT_STATUS),
32328 ADSB_VEHICLE_DATA::ID => {
32329 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
32330 }
32331 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
32332 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32333 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32334 ATTITUDE_QUATERNION_DATA::ID => {
32335 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32336 }
32337 ATTITUDE_QUATERNION_COV_DATA::ID => {
32338 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
32339 .map(Self::ATTITUDE_QUATERNION_COV)
32340 }
32341 ATTITUDE_TARGET_DATA::ID => {
32342 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
32343 }
32344 ATT_POS_MOCAP_DATA::ID => {
32345 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32346 }
32347 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
32348 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
32349 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
32350 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32351 }
32352 AUTOPILOT_VERSION_DATA::ID => {
32353 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
32354 }
32355 AVAILABLE_MODES_DATA::ID => {
32356 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
32357 }
32358 AVAILABLE_MODES_MONITOR_DATA::ID => {
32359 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32360 .map(Self::AVAILABLE_MODES_MONITOR)
32361 }
32362 BATTERY_INFO_DATA::ID => {
32363 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
32364 }
32365 BATTERY_STATUS_DATA::ID => {
32366 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32367 }
32368 BUTTON_CHANGE_DATA::ID => {
32369 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
32370 }
32371 CAMERA_CAPTURE_STATUS_DATA::ID => {
32372 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32373 }
32374 CAMERA_FOV_STATUS_DATA::ID => {
32375 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32376 }
32377 CAMERA_IMAGE_CAPTURED_DATA::ID => {
32378 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
32379 }
32380 CAMERA_INFORMATION_DATA::ID => {
32381 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
32382 }
32383 CAMERA_SETTINGS_DATA::ID => {
32384 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32385 }
32386 CAMERA_THERMAL_RANGE_DATA::ID => {
32387 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32388 }
32389 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32390 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32391 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32392 }
32393 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32394 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32395 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32396 }
32397 CAMERA_TRIGGER_DATA::ID => {
32398 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32399 }
32400 CANFD_FRAME_DATA::ID => {
32401 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32402 }
32403 CAN_FILTER_MODIFY_DATA::ID => {
32404 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32405 }
32406 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32407 CELLULAR_CONFIG_DATA::ID => {
32408 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
32409 }
32410 CELLULAR_STATUS_DATA::ID => {
32411 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
32412 }
32413 CHANGE_OPERATOR_CONTROL_DATA::ID => {
32414 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
32415 .map(Self::CHANGE_OPERATOR_CONTROL)
32416 }
32417 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
32418 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
32419 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
32420 }
32421 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32422 COMMAND_ACK_DATA::ID => {
32423 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
32424 }
32425 COMMAND_CANCEL_DATA::ID => {
32426 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32427 }
32428 COMMAND_INT_DATA::ID => {
32429 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32430 }
32431 COMMAND_LONG_DATA::ID => {
32432 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
32433 }
32434 COMPONENT_INFORMATION_DATA::ID => {
32435 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32436 }
32437 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32438 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32439 .map(Self::COMPONENT_INFORMATION_BASIC)
32440 }
32441 COMPONENT_METADATA_DATA::ID => {
32442 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32443 }
32444 CONTROL_SYSTEM_STATE_DATA::ID => {
32445 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32446 }
32447 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
32448 .map(Self::CURRENT_EVENT_SEQUENCE),
32449 CURRENT_MODE_DATA::ID => {
32450 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32451 }
32452 DATA_STREAM_DATA::ID => {
32453 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32454 }
32455 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
32456 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
32457 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
32458 }
32459 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
32460 DEBUG_FLOAT_ARRAY_DATA::ID => {
32461 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32462 }
32463 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32464 DISTANCE_SENSOR_DATA::ID => {
32465 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
32466 }
32467 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
32468 ENCAPSULATED_DATA_DATA::ID => {
32469 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32470 }
32471 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
32472 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32473 ESTIMATOR_STATUS_DATA::ID => {
32474 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
32475 }
32476 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
32477 EXTENDED_SYS_STATE_DATA::ID => {
32478 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32479 }
32480 FENCE_STATUS_DATA::ID => {
32481 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
32482 }
32483 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32484 .map(Self::FILE_TRANSFER_PROTOCOL),
32485 FLIGHT_INFORMATION_DATA::ID => {
32486 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32487 }
32488 FOLLOW_TARGET_DATA::ID => {
32489 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
32490 }
32491 FUEL_STATUS_DATA::ID => {
32492 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32493 }
32494 GENERATOR_STATUS_DATA::ID => {
32495 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32496 }
32497 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32498 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32499 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32500 }
32501 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32502 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32503 .map(Self::GIMBAL_DEVICE_INFORMATION)
32504 }
32505 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32506 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32507 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32508 }
32509 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32510 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32511 .map(Self::GIMBAL_MANAGER_INFORMATION)
32512 }
32513 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
32514 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
32515 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
32516 }
32517 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32518 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32519 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32520 }
32521 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
32522 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
32523 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
32524 }
32525 GIMBAL_MANAGER_STATUS_DATA::ID => {
32526 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
32527 }
32528 GLOBAL_POSITION_INT_DATA::ID => {
32529 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32530 }
32531 GLOBAL_POSITION_INT_COV_DATA::ID => {
32532 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
32533 .map(Self::GLOBAL_POSITION_INT_COV)
32534 }
32535 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
32536 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32537 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
32538 }
32539 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
32540 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
32541 GPS_GLOBAL_ORIGIN_DATA::ID => {
32542 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
32543 }
32544 GPS_INJECT_DATA_DATA::ID => {
32545 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
32546 }
32547 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
32548 GPS_RAW_INT_DATA::ID => {
32549 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
32550 }
32551 GPS_RTCM_DATA_DATA::ID => {
32552 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
32553 }
32554 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
32555 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
32556 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
32557 HIGHRES_IMU_DATA::ID => {
32558 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
32559 }
32560 HIGH_LATENCY_DATA::ID => {
32561 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32562 }
32563 HIGH_LATENCY2_DATA::ID => {
32564 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32565 }
32566 HIL_ACTUATOR_CONTROLS_DATA::ID => {
32567 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
32568 }
32569 HIL_CONTROLS_DATA::ID => {
32570 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
32571 }
32572 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32573 HIL_OPTICAL_FLOW_DATA::ID => {
32574 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32575 }
32576 HIL_RC_INPUTS_RAW_DATA::ID => {
32577 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32578 }
32579 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32580 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32581 HIL_STATE_QUATERNION_DATA::ID => {
32582 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32583 }
32584 HOME_POSITION_DATA::ID => {
32585 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
32586 }
32587 HYGROMETER_SENSOR_DATA::ID => {
32588 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
32589 }
32590 ILLUMINATOR_STATUS_DATA::ID => {
32591 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32592 }
32593 ISBD_LINK_STATUS_DATA::ID => {
32594 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
32595 }
32596 LANDING_TARGET_DATA::ID => {
32597 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
32598 }
32599 LINK_NODE_STATUS_DATA::ID => {
32600 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32601 }
32602 LOCAL_POSITION_NED_DATA::ID => {
32603 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32604 }
32605 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
32606 .map(Self::LOCAL_POSITION_NED_COV),
32607 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32608 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32609 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32610 }
32611 LOGGING_ACK_DATA::ID => {
32612 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32613 }
32614 LOGGING_DATA_DATA::ID => {
32615 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
32616 }
32617 LOGGING_DATA_ACKED_DATA::ID => {
32618 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32619 }
32620 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
32621 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32622 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32623 LOG_REQUEST_DATA_DATA::ID => {
32624 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
32625 }
32626 LOG_REQUEST_END_DATA::ID => {
32627 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
32628 }
32629 LOG_REQUEST_LIST_DATA::ID => {
32630 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
32631 }
32632 MAG_CAL_REPORT_DATA::ID => {
32633 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
32634 }
32635 MANUAL_CONTROL_DATA::ID => {
32636 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
32637 }
32638 MANUAL_SETPOINT_DATA::ID => {
32639 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
32640 }
32641 MEMORY_VECT_DATA::ID => {
32642 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
32643 }
32644 MESSAGE_INTERVAL_DATA::ID => {
32645 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
32646 }
32647 MISSION_ACK_DATA::ID => {
32648 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
32649 }
32650 MISSION_CLEAR_ALL_DATA::ID => {
32651 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
32652 }
32653 MISSION_COUNT_DATA::ID => {
32654 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
32655 }
32656 MISSION_CURRENT_DATA::ID => {
32657 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
32658 }
32659 MISSION_ITEM_DATA::ID => {
32660 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
32661 }
32662 MISSION_ITEM_INT_DATA::ID => {
32663 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
32664 }
32665 MISSION_ITEM_REACHED_DATA::ID => {
32666 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
32667 }
32668 MISSION_REQUEST_DATA::ID => {
32669 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32670 }
32671 MISSION_REQUEST_INT_DATA::ID => {
32672 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
32673 }
32674 MISSION_REQUEST_LIST_DATA::ID => {
32675 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32676 }
32677 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32678 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32679 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32680 }
32681 MISSION_SET_CURRENT_DATA::ID => {
32682 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
32683 }
32684 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
32685 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
32686 .map(Self::MISSION_WRITE_PARTIAL_LIST)
32687 }
32688 MOUNT_ORIENTATION_DATA::ID => {
32689 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32690 }
32691 NAMED_VALUE_FLOAT_DATA::ID => {
32692 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
32693 }
32694 NAMED_VALUE_INT_DATA::ID => {
32695 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32696 }
32697 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32698 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32699 }
32700 OBSTACLE_DISTANCE_DATA::ID => {
32701 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32702 }
32703 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
32704 ONBOARD_COMPUTER_STATUS_DATA::ID => {
32705 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
32706 .map(Self::ONBOARD_COMPUTER_STATUS)
32707 }
32708 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
32709 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
32710 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
32711 }
32712 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
32713 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
32714 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
32715 }
32716 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32717 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32718 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
32719 .map(Self::OPEN_DRONE_ID_LOCATION),
32720 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
32721 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
32722 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
32723 }
32724 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32725 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32726 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32727 }
32728 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
32729 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
32730 }
32731 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32732 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32733 }
32734 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
32735 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
32736 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
32737 }
32738 OPTICAL_FLOW_DATA::ID => {
32739 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32740 }
32741 OPTICAL_FLOW_RAD_DATA::ID => {
32742 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
32743 }
32744 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
32745 .map(Self::ORBIT_EXECUTION_STATUS),
32746 PARAM_EXT_ACK_DATA::ID => {
32747 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
32748 }
32749 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
32750 .map(Self::PARAM_EXT_REQUEST_LIST),
32751 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32752 .map(Self::PARAM_EXT_REQUEST_READ),
32753 PARAM_EXT_SET_DATA::ID => {
32754 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32755 }
32756 PARAM_EXT_VALUE_DATA::ID => {
32757 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32758 }
32759 PARAM_MAP_RC_DATA::ID => {
32760 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32761 }
32762 PARAM_REQUEST_LIST_DATA::ID => {
32763 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
32764 }
32765 PARAM_REQUEST_READ_DATA::ID => {
32766 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32767 }
32768 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32769 PARAM_VALUE_DATA::ID => {
32770 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32771 }
32772 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32773 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
32774 PLAY_TUNE_V2_DATA::ID => {
32775 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
32776 }
32777 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32778 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32779 .map(Self::POSITION_TARGET_GLOBAL_INT)
32780 }
32781 POSITION_TARGET_LOCAL_NED_DATA::ID => {
32782 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32783 .map(Self::POSITION_TARGET_LOCAL_NED)
32784 }
32785 POWER_STATUS_DATA::ID => {
32786 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32787 }
32788 PROTOCOL_VERSION_DATA::ID => {
32789 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32790 }
32791 RADIO_STATUS_DATA::ID => {
32792 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32793 }
32794 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
32795 RAW_PRESSURE_DATA::ID => {
32796 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
32797 }
32798 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
32799 RC_CHANNELS_DATA::ID => {
32800 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
32801 }
32802 RC_CHANNELS_OVERRIDE_DATA::ID => {
32803 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32804 }
32805 RC_CHANNELS_RAW_DATA::ID => {
32806 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32807 }
32808 RC_CHANNELS_SCALED_DATA::ID => {
32809 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
32810 }
32811 REQUEST_DATA_STREAM_DATA::ID => {
32812 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
32813 }
32814 REQUEST_EVENT_DATA::ID => {
32815 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32816 }
32817 RESOURCE_REQUEST_DATA::ID => {
32818 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32819 }
32820 RESPONSE_EVENT_ERROR_DATA::ID => {
32821 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32822 }
32823 SAFETY_ALLOWED_AREA_DATA::ID => {
32824 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32825 }
32826 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
32827 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
32828 .map(Self::SAFETY_SET_ALLOWED_AREA)
32829 }
32830 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
32831 SCALED_IMU2_DATA::ID => {
32832 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32833 }
32834 SCALED_IMU3_DATA::ID => {
32835 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32836 }
32837 SCALED_PRESSURE_DATA::ID => {
32838 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
32839 }
32840 SCALED_PRESSURE2_DATA::ID => {
32841 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
32842 }
32843 SCALED_PRESSURE3_DATA::ID => {
32844 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
32845 }
32846 SERIAL_CONTROL_DATA::ID => {
32847 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32848 }
32849 SERVO_OUTPUT_RAW_DATA::ID => {
32850 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
32851 }
32852 SETUP_SIGNING_DATA::ID => {
32853 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32854 }
32855 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
32856 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32857 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
32858 }
32859 SET_ATTITUDE_TARGET_DATA::ID => {
32860 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32861 }
32862 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32863 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32864 }
32865 SET_HOME_POSITION_DATA::ID => {
32866 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32867 }
32868 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
32869 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
32870 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
32871 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
32872 }
32873 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
32874 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
32875 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
32876 }
32877 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32878 SMART_BATTERY_INFO_DATA::ID => {
32879 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
32880 }
32881 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
32882 STORAGE_INFORMATION_DATA::ID => {
32883 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
32884 }
32885 SUPPORTED_TUNES_DATA::ID => {
32886 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32887 }
32888 SYSTEM_TIME_DATA::ID => {
32889 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
32890 }
32891 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32892 TERRAIN_CHECK_DATA::ID => {
32893 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
32894 }
32895 TERRAIN_DATA_DATA::ID => {
32896 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32897 }
32898 TERRAIN_REPORT_DATA::ID => {
32899 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
32900 }
32901 TERRAIN_REQUEST_DATA::ID => {
32902 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
32903 }
32904 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32905 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
32906 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
32907 .map(Self::TIME_ESTIMATE_TO_TARGET)
32908 }
32909 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32910 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32911 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32912 }
32913 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32914 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32915 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32916 }
32917 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32918 UAVCAN_NODE_INFO_DATA::ID => {
32919 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
32920 }
32921 UAVCAN_NODE_STATUS_DATA::ID => {
32922 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32923 }
32924 UAVIONIX_ADSB_GET_DATA::ID => {
32925 UAVIONIX_ADSB_GET_DATA::deser(version, payload).map(Self::UAVIONIX_ADSB_GET)
32926 }
32927 UAVIONIX_ADSB_OUT_CFG_DATA::ID => {
32928 UAVIONIX_ADSB_OUT_CFG_DATA::deser(version, payload).map(Self::UAVIONIX_ADSB_OUT_CFG)
32929 }
32930 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => {
32931 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::deser(version, payload)
32932 .map(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID)
32933 }
32934 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
32935 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::deser(version, payload)
32936 .map(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION)
32937 }
32938 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => {
32939 UAVIONIX_ADSB_OUT_CONTROL_DATA::deser(version, payload)
32940 .map(Self::UAVIONIX_ADSB_OUT_CONTROL)
32941 }
32942 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => {
32943 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::deser(version, payload)
32944 .map(Self::UAVIONIX_ADSB_OUT_DYNAMIC)
32945 }
32946 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => {
32947 UAVIONIX_ADSB_OUT_STATUS_DATA::deser(version, payload)
32948 .map(Self::UAVIONIX_ADSB_OUT_STATUS)
32949 }
32950 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
32951 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::deser(version, payload)
32952 .map(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT)
32953 }
32954 UTM_GLOBAL_POSITION_DATA::ID => {
32955 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
32956 }
32957 V2_EXTENSION_DATA::ID => {
32958 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
32959 }
32960 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
32961 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32962 VICON_POSITION_ESTIMATE_DATA::ID => {
32963 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32964 .map(Self::VICON_POSITION_ESTIMATE)
32965 }
32966 VIDEO_STREAM_INFORMATION_DATA::ID => {
32967 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32968 .map(Self::VIDEO_STREAM_INFORMATION)
32969 }
32970 VIDEO_STREAM_STATUS_DATA::ID => {
32971 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
32972 }
32973 VISION_POSITION_ESTIMATE_DATA::ID => {
32974 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32975 .map(Self::VISION_POSITION_ESTIMATE)
32976 }
32977 VISION_SPEED_ESTIMATE_DATA::ID => {
32978 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32979 }
32980 WHEEL_DISTANCE_DATA::ID => {
32981 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
32982 }
32983 WIFI_CONFIG_AP_DATA::ID => {
32984 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32985 }
32986 WINCH_STATUS_DATA::ID => {
32987 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
32988 }
32989 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
32990 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32991 }
32992 }
32993 fn message_name(&self) -> &'static str {
32994 match self {
32995 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32996 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32997 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32998 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32999 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33000 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33001 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33002 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33003 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33004 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33005 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33006 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33007 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33008 }
33009 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33010 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33011 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33012 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33013 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33014 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33015 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33016 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33017 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33018 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33019 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33020 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33021 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33022 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33023 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33024 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33025 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33026 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33027 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33028 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33029 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33030 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33031 Self::COLLISION(..) => COLLISION_DATA::NAME,
33032 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33033 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33034 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33035 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33036 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33037 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33038 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33039 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33040 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33041 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33042 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33043 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33044 Self::DEBUG(..) => DEBUG_DATA::NAME,
33045 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33046 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33047 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33048 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33049 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33050 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33051 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33052 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33053 Self::EVENT(..) => EVENT_DATA::NAME,
33054 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33055 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33056 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33057 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33058 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33059 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33060 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33061 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33062 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33063 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33064 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33065 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33066 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33067 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33068 }
33069 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33070 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33071 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33072 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33073 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33074 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33075 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33076 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33077 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33078 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33079 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33080 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33081 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33082 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33083 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33084 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33085 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33086 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33087 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33088 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33089 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33090 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33091 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33092 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33093 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33094 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33095 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33096 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33097 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33098 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33099 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33100 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33101 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33102 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33103 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33104 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33105 }
33106 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33107 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33108 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33109 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33110 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33111 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33112 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33113 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33114 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33115 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33116 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33117 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33118 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33119 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33120 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33121 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33122 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33123 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33124 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33125 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33126 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33127 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33128 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33129 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33130 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33131 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33132 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33133 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33134 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33135 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33136 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33137 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33138 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33139 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33140 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33141 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33142 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33143 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33144 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33145 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33146 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33147 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33148 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33149 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33150 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33151 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33152 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33153 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33154 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33155 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33156 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33157 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33158 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33159 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33160 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33161 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33162 Self::PING(..) => PING_DATA::NAME,
33163 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33164 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33165 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33166 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33167 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33168 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33169 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33170 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33171 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33172 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33173 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33174 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33175 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33176 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33177 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33178 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33179 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33180 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33181 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33182 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33183 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33184 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33185 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33186 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33187 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33188 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33189 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33190 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33191 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33192 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33193 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33194 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33195 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33196 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33197 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33198 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33199 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33200 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33201 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33202 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33203 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33204 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33205 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33206 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33207 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33208 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33209 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33210 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33211 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33212 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33213 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33214 }
33215 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33216 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33217 }
33218 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33219 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33220 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33221 Self::UAVIONIX_ADSB_GET(..) => UAVIONIX_ADSB_GET_DATA::NAME,
33222 Self::UAVIONIX_ADSB_OUT_CFG(..) => UAVIONIX_ADSB_OUT_CFG_DATA::NAME,
33223 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(..) => UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME,
33224 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(..) => {
33225 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME
33226 }
33227 Self::UAVIONIX_ADSB_OUT_CONTROL(..) => UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME,
33228 Self::UAVIONIX_ADSB_OUT_DYNAMIC(..) => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME,
33229 Self::UAVIONIX_ADSB_OUT_STATUS(..) => UAVIONIX_ADSB_OUT_STATUS_DATA::NAME,
33230 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(..) => {
33231 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME
33232 }
33233 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33234 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33235 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33236 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33237 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33238 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33239 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33240 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33241 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33242 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33243 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33244 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33245 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33246 }
33247 }
33248 fn message_id(&self) -> u32 {
33249 match self {
33250 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33251 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33252 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33253 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33254 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33255 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33256 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33257 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33258 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33259 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33260 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33261 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33262 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33263 }
33264 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33265 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33266 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33267 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33268 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33269 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33270 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33271 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33272 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33273 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33274 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33275 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33276 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33277 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33278 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33279 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33280 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33281 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33282 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33283 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33284 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33285 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33286 Self::COLLISION(..) => COLLISION_DATA::ID,
33287 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33288 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33289 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33290 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33291 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33292 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33293 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33294 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33295 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33296 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33297 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33298 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33299 Self::DEBUG(..) => DEBUG_DATA::ID,
33300 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33301 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33302 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33303 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33304 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33305 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33306 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33307 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33308 Self::EVENT(..) => EVENT_DATA::ID,
33309 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33310 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
33311 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
33312 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
33313 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
33314 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
33315 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
33316 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
33317 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
33318 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
33319 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
33320 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
33321 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33322 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
33323 }
33324 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
33325 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
33326 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
33327 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
33328 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
33329 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
33330 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
33331 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
33332 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
33333 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
33334 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
33335 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
33336 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
33337 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
33338 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
33339 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
33340 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
33341 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
33342 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
33343 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
33344 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
33345 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
33346 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
33347 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
33348 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
33349 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
33350 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
33351 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
33352 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
33353 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
33354 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
33355 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
33356 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
33357 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
33358 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33359 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
33360 }
33361 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
33362 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
33363 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
33364 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
33365 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
33366 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
33367 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
33368 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
33369 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
33370 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
33371 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
33372 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
33373 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
33374 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
33375 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
33376 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
33377 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
33378 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
33379 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
33380 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
33381 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
33382 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
33383 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
33384 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
33385 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
33386 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
33387 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
33388 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
33389 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
33390 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
33391 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
33392 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
33393 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
33394 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
33395 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
33396 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
33397 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
33398 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
33399 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
33400 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
33401 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
33402 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
33403 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
33404 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
33405 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
33406 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
33407 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
33408 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
33409 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
33410 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
33411 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
33412 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
33413 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
33414 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
33415 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
33416 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
33417 Self::PING(..) => PING_DATA::ID,
33418 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
33419 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
33420 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
33421 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
33422 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
33423 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
33424 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
33425 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
33426 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
33427 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
33428 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
33429 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
33430 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
33431 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
33432 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
33433 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
33434 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
33435 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
33436 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
33437 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
33438 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
33439 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
33440 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
33441 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
33442 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
33443 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
33444 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
33445 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
33446 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
33447 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
33448 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
33449 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
33450 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
33451 Self::SET_MODE(..) => SET_MODE_DATA::ID,
33452 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
33453 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
33454 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
33455 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
33456 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
33457 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
33458 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
33459 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
33460 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
33461 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
33462 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
33463 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
33464 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
33465 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
33466 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
33467 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
33468 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33469 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
33470 }
33471 Self::TUNNEL(..) => TUNNEL_DATA::ID,
33472 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
33473 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
33474 Self::UAVIONIX_ADSB_GET(..) => UAVIONIX_ADSB_GET_DATA::ID,
33475 Self::UAVIONIX_ADSB_OUT_CFG(..) => UAVIONIX_ADSB_OUT_CFG_DATA::ID,
33476 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(..) => UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID,
33477 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(..) => {
33478 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID
33479 }
33480 Self::UAVIONIX_ADSB_OUT_CONTROL(..) => UAVIONIX_ADSB_OUT_CONTROL_DATA::ID,
33481 Self::UAVIONIX_ADSB_OUT_DYNAMIC(..) => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID,
33482 Self::UAVIONIX_ADSB_OUT_STATUS(..) => UAVIONIX_ADSB_OUT_STATUS_DATA::ID,
33483 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(..) => {
33484 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID
33485 }
33486 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
33487 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
33488 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
33489 Self::VIBRATION(..) => VIBRATION_DATA::ID,
33490 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
33491 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
33492 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
33493 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
33494 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
33495 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
33496 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
33497 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
33498 Self::WIND_COV(..) => WIND_COV_DATA::ID,
33499 }
33500 }
33501 fn message_id_from_name(name: &str) -> Option<u32> {
33502 match name {
33503 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
33504 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
33505 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
33506 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
33507 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
33508 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33509 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33510 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
33511 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
33512 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33513 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
33514 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
33515 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
33516 }
33517 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
33518 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
33519 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
33520 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
33521 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33522 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
33523 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33524 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
33525 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
33526 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
33527 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33528 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
33529 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
33530 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33531 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
33532 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
33533 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
33534 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
33535 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
33536 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
33537 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
33538 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
33539 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
33540 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
33541 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
33542 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
33543 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
33544 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
33545 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
33546 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
33547 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
33548 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
33549 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
33550 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
33551 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
33552 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
33553 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
33554 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
33555 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
33556 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
33557 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
33558 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
33559 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
33560 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
33561 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
33562 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
33563 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
33564 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
33565 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
33566 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
33567 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
33568 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
33569 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
33570 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
33571 }
33572 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
33573 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
33574 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
33575 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
33576 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
33577 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
33578 }
33579 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
33580 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
33581 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
33582 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
33583 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
33584 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
33585 }
33586 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
33587 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
33588 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
33589 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
33590 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
33591 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
33592 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
33593 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
33594 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
33595 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
33596 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
33597 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
33598 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33599 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
33600 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
33601 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
33602 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33603 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33604 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33605 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
33606 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33607 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
33608 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
33609 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
33610 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
33611 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
33612 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33613 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33614 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
33615 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
33616 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
33617 }
33618 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
33619 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
33620 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33621 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
33622 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33623 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33624 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
33625 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
33626 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33627 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33628 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
33629 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33630 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
33631 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
33632 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33633 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
33634 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
33635 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
33636 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
33637 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
33638 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
33639 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33640 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
33641 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33642 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33643 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
33644 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
33645 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
33646 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
33647 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33648 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33649 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33650 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
33651 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
33652 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
33653 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
33654 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33655 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
33656 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
33657 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33658 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
33659 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33660 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
33661 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
33662 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
33663 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
33664 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
33665 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
33666 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
33667 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
33668 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
33669 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
33670 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
33671 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
33672 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
33673 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
33674 PING_DATA::NAME => Some(PING_DATA::ID),
33675 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
33676 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
33677 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
33678 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
33679 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
33680 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
33681 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
33682 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
33683 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
33684 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
33685 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
33686 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
33687 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
33688 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
33689 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
33690 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
33691 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
33692 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
33693 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
33694 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
33695 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
33696 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33697 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33698 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
33699 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
33700 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
33701 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
33702 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
33703 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
33704 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
33705 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33706 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33707 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33708 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
33709 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
33710 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
33711 }
33712 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
33713 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
33714 }
33715 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33716 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
33717 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
33718 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
33719 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33720 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
33721 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33722 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
33723 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33724 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
33725 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
33726 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
33727 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
33728 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33729 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33730 }
33731 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
33732 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
33733 }
33734 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33735 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
33736 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
33737 UAVIONIX_ADSB_GET_DATA::NAME => Some(UAVIONIX_ADSB_GET_DATA::ID),
33738 UAVIONIX_ADSB_OUT_CFG_DATA::NAME => Some(UAVIONIX_ADSB_OUT_CFG_DATA::ID),
33739 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::NAME => {
33740 Some(UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID)
33741 }
33742 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::NAME => {
33743 Some(UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID)
33744 }
33745 UAVIONIX_ADSB_OUT_CONTROL_DATA::NAME => Some(UAVIONIX_ADSB_OUT_CONTROL_DATA::ID),
33746 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::NAME => Some(UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID),
33747 UAVIONIX_ADSB_OUT_STATUS_DATA::NAME => Some(UAVIONIX_ADSB_OUT_STATUS_DATA::ID),
33748 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::NAME => {
33749 Some(UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID)
33750 }
33751 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
33752 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
33753 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
33754 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33755 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33756 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33757 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
33758 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
33759 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33760 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
33761 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
33762 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
33763 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
33764 _ => None,
33765 }
33766 }
33767 fn default_message_from_id(id: u32) -> Option<Self> {
33768 match id {
33769 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33770 ACTUATOR_CONTROL_TARGET_DATA::default(),
33771 )),
33772 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33773 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33774 )),
33775 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33776 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33777 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33778 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33779 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33780 ATTITUDE_QUATERNION_DATA::default(),
33781 )),
33782 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33783 ATTITUDE_QUATERNION_COV_DATA::default(),
33784 )),
33785 ATTITUDE_TARGET_DATA::ID => {
33786 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33787 }
33788 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33789 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33790 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33791 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33792 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33793 ))
33794 }
33795 AUTOPILOT_VERSION_DATA::ID => {
33796 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33797 }
33798 AVAILABLE_MODES_DATA::ID => {
33799 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33800 }
33801 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33802 AVAILABLE_MODES_MONITOR_DATA::default(),
33803 )),
33804 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33805 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33806 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33807 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33808 CAMERA_CAPTURE_STATUS_DATA::default(),
33809 )),
33810 CAMERA_FOV_STATUS_DATA::ID => {
33811 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33812 }
33813 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33814 CAMERA_IMAGE_CAPTURED_DATA::default(),
33815 )),
33816 CAMERA_INFORMATION_DATA::ID => {
33817 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33818 }
33819 CAMERA_SETTINGS_DATA::ID => {
33820 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33821 }
33822 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33823 CAMERA_THERMAL_RANGE_DATA::default(),
33824 )),
33825 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33826 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33827 )),
33828 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33829 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33830 )),
33831 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33832 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33833 CAN_FILTER_MODIFY_DATA::ID => {
33834 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33835 }
33836 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33837 CELLULAR_CONFIG_DATA::ID => {
33838 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33839 }
33840 CELLULAR_STATUS_DATA::ID => {
33841 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33842 }
33843 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33844 CHANGE_OPERATOR_CONTROL_DATA::default(),
33845 )),
33846 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33847 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33848 )),
33849 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33850 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33851 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33852 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33853 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33854 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33855 COMPONENT_INFORMATION_DATA::default(),
33856 )),
33857 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33858 COMPONENT_INFORMATION_BASIC_DATA::default(),
33859 )),
33860 COMPONENT_METADATA_DATA::ID => {
33861 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33862 }
33863 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33864 CONTROL_SYSTEM_STATE_DATA::default(),
33865 )),
33866 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33867 CURRENT_EVENT_SEQUENCE_DATA::default(),
33868 )),
33869 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33870 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33871 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33872 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33873 )),
33874 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33875 DEBUG_FLOAT_ARRAY_DATA::ID => {
33876 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33877 }
33878 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33879 DISTANCE_SENSOR_DATA::ID => {
33880 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33881 }
33882 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33883 ENCAPSULATED_DATA_DATA::ID => {
33884 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33885 }
33886 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33887 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33888 ESTIMATOR_STATUS_DATA::ID => {
33889 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33890 }
33891 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33892 EXTENDED_SYS_STATE_DATA::ID => {
33893 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33894 }
33895 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33896 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33897 FILE_TRANSFER_PROTOCOL_DATA::default(),
33898 )),
33899 FLIGHT_INFORMATION_DATA::ID => {
33900 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33901 }
33902 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33903 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33904 GENERATOR_STATUS_DATA::ID => {
33905 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33906 }
33907 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33908 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33909 )),
33910 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33911 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33912 )),
33913 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33914 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33915 )),
33916 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33917 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33918 )),
33919 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33920 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33921 )),
33922 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33923 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33924 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33925 ))
33926 }
33927 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33928 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33929 )),
33930 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33931 GIMBAL_MANAGER_STATUS_DATA::default(),
33932 )),
33933 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33934 GLOBAL_POSITION_INT_DATA::default(),
33935 )),
33936 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33937 GLOBAL_POSITION_INT_COV_DATA::default(),
33938 )),
33939 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33940 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33941 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33942 ))
33943 }
33944 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33945 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33946 GPS_GLOBAL_ORIGIN_DATA::ID => {
33947 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33948 }
33949 GPS_INJECT_DATA_DATA::ID => {
33950 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33951 }
33952 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33953 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33954 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33955 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33956 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33957 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33958 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33959 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33960 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33961 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33962 HIL_ACTUATOR_CONTROLS_DATA::default(),
33963 )),
33964 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33965 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33966 HIL_OPTICAL_FLOW_DATA::ID => {
33967 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33968 }
33969 HIL_RC_INPUTS_RAW_DATA::ID => {
33970 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33971 }
33972 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33973 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33974 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33975 HIL_STATE_QUATERNION_DATA::default(),
33976 )),
33977 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33978 HYGROMETER_SENSOR_DATA::ID => {
33979 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33980 }
33981 ILLUMINATOR_STATUS_DATA::ID => {
33982 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33983 }
33984 ISBD_LINK_STATUS_DATA::ID => {
33985 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33986 }
33987 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33988 LINK_NODE_STATUS_DATA::ID => {
33989 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33990 }
33991 LOCAL_POSITION_NED_DATA::ID => {
33992 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33993 }
33994 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33995 LOCAL_POSITION_NED_COV_DATA::default(),
33996 )),
33997 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33998 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33999 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34000 ))
34001 }
34002 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34003 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34004 LOGGING_DATA_ACKED_DATA::ID => {
34005 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34006 }
34007 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34008 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34009 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34010 LOG_REQUEST_DATA_DATA::ID => {
34011 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34012 }
34013 LOG_REQUEST_END_DATA::ID => {
34014 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34015 }
34016 LOG_REQUEST_LIST_DATA::ID => {
34017 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34018 }
34019 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34020 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34021 MANUAL_SETPOINT_DATA::ID => {
34022 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34023 }
34024 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34025 MESSAGE_INTERVAL_DATA::ID => {
34026 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34027 }
34028 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34029 MISSION_CLEAR_ALL_DATA::ID => {
34030 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34031 }
34032 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34033 MISSION_CURRENT_DATA::ID => {
34034 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34035 }
34036 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34037 MISSION_ITEM_INT_DATA::ID => {
34038 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34039 }
34040 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34041 MISSION_ITEM_REACHED_DATA::default(),
34042 )),
34043 MISSION_REQUEST_DATA::ID => {
34044 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34045 }
34046 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34047 MISSION_REQUEST_INT_DATA::default(),
34048 )),
34049 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34050 MISSION_REQUEST_LIST_DATA::default(),
34051 )),
34052 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34053 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34054 )),
34055 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34056 MISSION_SET_CURRENT_DATA::default(),
34057 )),
34058 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34059 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34060 )),
34061 MOUNT_ORIENTATION_DATA::ID => {
34062 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34063 }
34064 NAMED_VALUE_FLOAT_DATA::ID => {
34065 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34066 }
34067 NAMED_VALUE_INT_DATA::ID => {
34068 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34069 }
34070 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34071 NAV_CONTROLLER_OUTPUT_DATA::default(),
34072 )),
34073 OBSTACLE_DISTANCE_DATA::ID => {
34074 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34075 }
34076 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34077 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34078 ONBOARD_COMPUTER_STATUS_DATA::default(),
34079 )),
34080 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34081 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34082 )),
34083 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34084 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34085 )),
34086 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34087 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34088 )),
34089 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34090 OPEN_DRONE_ID_LOCATION_DATA::default(),
34091 )),
34092 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34093 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34094 )),
34095 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34096 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34097 )),
34098 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34099 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34100 )),
34101 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34102 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34103 )),
34104 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34105 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34106 )),
34107 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34108 OPTICAL_FLOW_RAD_DATA::ID => {
34109 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34110 }
34111 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34112 ORBIT_EXECUTION_STATUS_DATA::default(),
34113 )),
34114 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34115 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34116 PARAM_EXT_REQUEST_LIST_DATA::default(),
34117 )),
34118 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34119 PARAM_EXT_REQUEST_READ_DATA::default(),
34120 )),
34121 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34122 PARAM_EXT_VALUE_DATA::ID => {
34123 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34124 }
34125 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34126 PARAM_REQUEST_LIST_DATA::ID => {
34127 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34128 }
34129 PARAM_REQUEST_READ_DATA::ID => {
34130 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34131 }
34132 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34133 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34134 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34135 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34136 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34137 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34138 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34139 )),
34140 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34141 POSITION_TARGET_LOCAL_NED_DATA::default(),
34142 )),
34143 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34144 PROTOCOL_VERSION_DATA::ID => {
34145 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34146 }
34147 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34148 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34149 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34150 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34151 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34152 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34153 RC_CHANNELS_OVERRIDE_DATA::default(),
34154 )),
34155 RC_CHANNELS_RAW_DATA::ID => {
34156 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34157 }
34158 RC_CHANNELS_SCALED_DATA::ID => {
34159 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34160 }
34161 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34162 REQUEST_DATA_STREAM_DATA::default(),
34163 )),
34164 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34165 RESOURCE_REQUEST_DATA::ID => {
34166 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34167 }
34168 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34169 RESPONSE_EVENT_ERROR_DATA::default(),
34170 )),
34171 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34172 SAFETY_ALLOWED_AREA_DATA::default(),
34173 )),
34174 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34175 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34176 )),
34177 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34178 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34179 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34180 SCALED_PRESSURE_DATA::ID => {
34181 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34182 }
34183 SCALED_PRESSURE2_DATA::ID => {
34184 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34185 }
34186 SCALED_PRESSURE3_DATA::ID => {
34187 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34188 }
34189 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34190 SERVO_OUTPUT_RAW_DATA::ID => {
34191 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34192 }
34193 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34194 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34195 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34196 )),
34197 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34198 SET_ATTITUDE_TARGET_DATA::default(),
34199 )),
34200 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34201 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34202 )),
34203 SET_HOME_POSITION_DATA::ID => {
34204 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34205 }
34206 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34207 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34208 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34209 )),
34210 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34211 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34212 )),
34213 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34214 SMART_BATTERY_INFO_DATA::ID => {
34215 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34216 }
34217 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34218 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34219 STORAGE_INFORMATION_DATA::default(),
34220 )),
34221 SUPPORTED_TUNES_DATA::ID => {
34222 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34223 }
34224 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34225 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34226 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34227 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34228 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34229 TERRAIN_REQUEST_DATA::ID => {
34230 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34231 }
34232 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34233 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34234 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34235 )),
34236 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34237 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34238 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34239 ))
34240 }
34241 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34242 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34243 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34244 ))
34245 }
34246 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34247 UAVCAN_NODE_INFO_DATA::ID => {
34248 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34249 }
34250 UAVCAN_NODE_STATUS_DATA::ID => {
34251 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34252 }
34253 UAVIONIX_ADSB_GET_DATA::ID => {
34254 Some(Self::UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA::default()))
34255 }
34256 UAVIONIX_ADSB_OUT_CFG_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG(
34257 UAVIONIX_ADSB_OUT_CFG_DATA::default(),
34258 )),
34259 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(
34260 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::default(),
34261 )),
34262 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
34263 Some(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(
34264 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::default(),
34265 ))
34266 }
34267 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CONTROL(
34268 UAVIONIX_ADSB_OUT_CONTROL_DATA::default(),
34269 )),
34270 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_DYNAMIC(
34271 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::default(),
34272 )),
34273 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_STATUS(
34274 UAVIONIX_ADSB_OUT_STATUS_DATA::default(),
34275 )),
34276 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
34277 Some(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(
34278 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::default(),
34279 ))
34280 }
34281 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34282 UTM_GLOBAL_POSITION_DATA::default(),
34283 )),
34284 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34285 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34286 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34287 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34288 VICON_POSITION_ESTIMATE_DATA::default(),
34289 )),
34290 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34291 VIDEO_STREAM_INFORMATION_DATA::default(),
34292 )),
34293 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34294 VIDEO_STREAM_STATUS_DATA::default(),
34295 )),
34296 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34297 VISION_POSITION_ESTIMATE_DATA::default(),
34298 )),
34299 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34300 VISION_SPEED_ESTIMATE_DATA::default(),
34301 )),
34302 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34303 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34304 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34305 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34306 _ => None,
34307 }
34308 }
34309 #[cfg(feature = "arbitrary")]
34310 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34311 match id {
34312 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34313 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34314 )),
34315 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34316 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34317 )),
34318 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34319 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34320 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34321 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34322 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34323 ATTITUDE_QUATERNION_DATA::random(rng),
34324 )),
34325 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34326 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34327 )),
34328 ATTITUDE_TARGET_DATA::ID => {
34329 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34330 }
34331 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34332 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34333 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34334 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34335 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34336 ))
34337 }
34338 AUTOPILOT_VERSION_DATA::ID => {
34339 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34340 }
34341 AVAILABLE_MODES_DATA::ID => {
34342 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34343 }
34344 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34345 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34346 )),
34347 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34348 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34349 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34350 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34351 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34352 )),
34353 CAMERA_FOV_STATUS_DATA::ID => {
34354 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34355 }
34356 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34357 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34358 )),
34359 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34360 CAMERA_INFORMATION_DATA::random(rng),
34361 )),
34362 CAMERA_SETTINGS_DATA::ID => {
34363 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34364 }
34365 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34366 CAMERA_THERMAL_RANGE_DATA::random(rng),
34367 )),
34368 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34369 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
34370 )),
34371 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34372 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34373 )),
34374 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
34375 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
34376 CAN_FILTER_MODIFY_DATA::ID => {
34377 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
34378 }
34379 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
34380 CELLULAR_CONFIG_DATA::ID => {
34381 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
34382 }
34383 CELLULAR_STATUS_DATA::ID => {
34384 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
34385 }
34386 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34387 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
34388 )),
34389 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34390 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
34391 )),
34392 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
34393 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
34394 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
34395 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34396 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
34397 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34398 COMPONENT_INFORMATION_DATA::random(rng),
34399 )),
34400 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34401 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34402 )),
34403 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
34404 COMPONENT_METADATA_DATA::random(rng),
34405 )),
34406 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34407 CONTROL_SYSTEM_STATE_DATA::random(rng),
34408 )),
34409 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34410 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
34411 )),
34412 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34413 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34414 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34415 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
34416 )),
34417 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
34418 DEBUG_FLOAT_ARRAY_DATA::ID => {
34419 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34420 }
34421 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
34422 DISTANCE_SENSOR_DATA::ID => {
34423 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
34424 }
34425 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
34426 ENCAPSULATED_DATA_DATA::ID => {
34427 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34428 }
34429 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
34430 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
34431 ESTIMATOR_STATUS_DATA::ID => {
34432 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
34433 }
34434 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
34435 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
34436 EXTENDED_SYS_STATE_DATA::random(rng),
34437 )),
34438 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
34439 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34440 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
34441 )),
34442 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34443 FLIGHT_INFORMATION_DATA::random(rng),
34444 )),
34445 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
34446 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34447 GENERATOR_STATUS_DATA::ID => {
34448 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
34449 }
34450 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34451 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34452 )),
34453 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34454 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
34455 )),
34456 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34457 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
34458 )),
34459 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34460 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
34461 )),
34462 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34463 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
34464 )),
34465 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34466 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34467 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
34468 ))
34469 }
34470 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34471 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
34472 )),
34473 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34474 GIMBAL_MANAGER_STATUS_DATA::random(rng),
34475 )),
34476 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34477 GLOBAL_POSITION_INT_DATA::random(rng),
34478 )),
34479 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34480 GLOBAL_POSITION_INT_COV_DATA::random(rng),
34481 )),
34482 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34483 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34484 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34485 ))
34486 }
34487 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
34488 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
34489 GPS_GLOBAL_ORIGIN_DATA::ID => {
34490 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
34491 }
34492 GPS_INJECT_DATA_DATA::ID => {
34493 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
34494 }
34495 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
34496 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
34497 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
34498 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
34499 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
34500 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
34501 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
34502 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34503 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34504 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34505 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
34506 )),
34507 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
34508 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
34509 HIL_OPTICAL_FLOW_DATA::ID => {
34510 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34511 }
34512 HIL_RC_INPUTS_RAW_DATA::ID => {
34513 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34514 }
34515 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
34516 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
34517 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34518 HIL_STATE_QUATERNION_DATA::random(rng),
34519 )),
34520 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
34521 HYGROMETER_SENSOR_DATA::ID => {
34522 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
34523 }
34524 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
34525 ILLUMINATOR_STATUS_DATA::random(rng),
34526 )),
34527 ISBD_LINK_STATUS_DATA::ID => {
34528 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
34529 }
34530 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
34531 LINK_NODE_STATUS_DATA::ID => {
34532 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
34533 }
34534 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
34535 LOCAL_POSITION_NED_DATA::random(rng),
34536 )),
34537 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34538 LOCAL_POSITION_NED_COV_DATA::random(rng),
34539 )),
34540 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34541 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34542 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
34543 ))
34544 }
34545 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
34546 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
34547 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
34548 LOGGING_DATA_ACKED_DATA::random(rng),
34549 )),
34550 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
34551 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
34552 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
34553 LOG_REQUEST_DATA_DATA::ID => {
34554 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
34555 }
34556 LOG_REQUEST_END_DATA::ID => {
34557 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
34558 }
34559 LOG_REQUEST_LIST_DATA::ID => {
34560 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
34561 }
34562 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
34563 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
34564 MANUAL_SETPOINT_DATA::ID => {
34565 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
34566 }
34567 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
34568 MESSAGE_INTERVAL_DATA::ID => {
34569 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
34570 }
34571 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
34572 MISSION_CLEAR_ALL_DATA::ID => {
34573 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
34574 }
34575 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
34576 MISSION_CURRENT_DATA::ID => {
34577 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
34578 }
34579 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
34580 MISSION_ITEM_INT_DATA::ID => {
34581 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
34582 }
34583 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34584 MISSION_ITEM_REACHED_DATA::random(rng),
34585 )),
34586 MISSION_REQUEST_DATA::ID => {
34587 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
34588 }
34589 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34590 MISSION_REQUEST_INT_DATA::random(rng),
34591 )),
34592 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34593 MISSION_REQUEST_LIST_DATA::random(rng),
34594 )),
34595 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34596 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
34597 )),
34598 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34599 MISSION_SET_CURRENT_DATA::random(rng),
34600 )),
34601 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34602 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
34603 )),
34604 MOUNT_ORIENTATION_DATA::ID => {
34605 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
34606 }
34607 NAMED_VALUE_FLOAT_DATA::ID => {
34608 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
34609 }
34610 NAMED_VALUE_INT_DATA::ID => {
34611 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
34612 }
34613 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34614 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
34615 )),
34616 OBSTACLE_DISTANCE_DATA::ID => {
34617 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
34618 }
34619 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
34620 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34621 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
34622 )),
34623 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34624 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
34625 )),
34626 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34627 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
34628 )),
34629 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34630 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34631 )),
34632 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34633 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
34634 )),
34635 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34636 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
34637 )),
34638 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34639 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34640 )),
34641 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34642 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
34643 )),
34644 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34645 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34646 )),
34647 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34648 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
34649 )),
34650 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
34651 OPTICAL_FLOW_RAD_DATA::ID => {
34652 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
34653 }
34654 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34655 ORBIT_EXECUTION_STATUS_DATA::random(rng),
34656 )),
34657 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
34658 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34659 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
34660 )),
34661 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34662 PARAM_EXT_REQUEST_READ_DATA::random(rng),
34663 )),
34664 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34665 PARAM_EXT_VALUE_DATA::ID => {
34666 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
34667 }
34668 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34669 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
34670 PARAM_REQUEST_LIST_DATA::random(rng),
34671 )),
34672 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34673 PARAM_REQUEST_READ_DATA::random(rng),
34674 )),
34675 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34676 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
34677 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
34678 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
34679 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
34680 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34681 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34682 )),
34683 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34684 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34685 )),
34686 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34687 PROTOCOL_VERSION_DATA::ID => {
34688 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
34689 }
34690 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
34691 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
34692 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
34693 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
34694 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
34695 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34696 RC_CHANNELS_OVERRIDE_DATA::random(rng),
34697 )),
34698 RC_CHANNELS_RAW_DATA::ID => {
34699 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
34700 }
34701 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
34702 RC_CHANNELS_SCALED_DATA::random(rng),
34703 )),
34704 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34705 REQUEST_DATA_STREAM_DATA::random(rng),
34706 )),
34707 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
34708 RESOURCE_REQUEST_DATA::ID => {
34709 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
34710 }
34711 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34712 RESPONSE_EVENT_ERROR_DATA::random(rng),
34713 )),
34714 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34715 SAFETY_ALLOWED_AREA_DATA::random(rng),
34716 )),
34717 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34718 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
34719 )),
34720 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
34721 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
34722 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
34723 SCALED_PRESSURE_DATA::ID => {
34724 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
34725 }
34726 SCALED_PRESSURE2_DATA::ID => {
34727 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
34728 }
34729 SCALED_PRESSURE3_DATA::ID => {
34730 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
34731 }
34732 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
34733 SERVO_OUTPUT_RAW_DATA::ID => {
34734 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
34735 }
34736 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
34737 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34738 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34739 )),
34740 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34741 SET_ATTITUDE_TARGET_DATA::random(rng),
34742 )),
34743 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34744 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34745 )),
34746 SET_HOME_POSITION_DATA::ID => {
34747 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
34748 }
34749 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
34750 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34751 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34752 )),
34753 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34754 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34755 )),
34756 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34757 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
34758 SMART_BATTERY_INFO_DATA::random(rng),
34759 )),
34760 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
34761 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34762 STORAGE_INFORMATION_DATA::random(rng),
34763 )),
34764 SUPPORTED_TUNES_DATA::ID => {
34765 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34766 }
34767 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
34768 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34769 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
34770 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34771 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
34772 TERRAIN_REQUEST_DATA::ID => {
34773 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
34774 }
34775 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
34776 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34777 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
34778 )),
34779 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34780 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34781 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34782 ))
34783 }
34784 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34785 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34786 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
34787 ))
34788 }
34789 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34790 UAVCAN_NODE_INFO_DATA::ID => {
34791 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
34792 }
34793 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
34794 UAVCAN_NODE_STATUS_DATA::random(rng),
34795 )),
34796 UAVIONIX_ADSB_GET_DATA::ID => {
34797 Some(Self::UAVIONIX_ADSB_GET(UAVIONIX_ADSB_GET_DATA::random(rng)))
34798 }
34799 UAVIONIX_ADSB_OUT_CFG_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG(
34800 UAVIONIX_ADSB_OUT_CFG_DATA::random(rng),
34801 )),
34802 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(
34803 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::random(rng),
34804 )),
34805 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
34806 Some(Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(
34807 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::random(rng),
34808 ))
34809 }
34810 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_CONTROL(
34811 UAVIONIX_ADSB_OUT_CONTROL_DATA::random(rng),
34812 )),
34813 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_DYNAMIC(
34814 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::random(rng),
34815 )),
34816 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => Some(Self::UAVIONIX_ADSB_OUT_STATUS(
34817 UAVIONIX_ADSB_OUT_STATUS_DATA::random(rng),
34818 )),
34819 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
34820 Some(Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(
34821 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::random(rng),
34822 ))
34823 }
34824 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34825 UTM_GLOBAL_POSITION_DATA::random(rng),
34826 )),
34827 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
34828 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
34829 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34830 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34831 VICON_POSITION_ESTIMATE_DATA::random(rng),
34832 )),
34833 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34834 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34835 )),
34836 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34837 VIDEO_STREAM_STATUS_DATA::random(rng),
34838 )),
34839 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34840 VISION_POSITION_ESTIMATE_DATA::random(rng),
34841 )),
34842 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34843 VISION_SPEED_ESTIMATE_DATA::random(rng),
34844 )),
34845 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
34846 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
34847 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
34848 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
34849 _ => None,
34850 }
34851 }
34852 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34853 match self {
34854 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34855 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34856 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34857 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34858 Self::ALTITUDE(body) => body.ser(version, bytes),
34859 Self::ATTITUDE(body) => body.ser(version, bytes),
34860 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34861 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34862 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34863 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34864 Self::AUTH_KEY(body) => body.ser(version, bytes),
34865 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34866 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34867 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34868 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34869 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34870 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34871 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34872 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34873 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34874 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34875 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34876 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34877 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34878 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34879 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34880 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34881 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34882 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34883 Self::CAN_FRAME(body) => body.ser(version, bytes),
34884 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34885 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34886 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34887 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34888 Self::COLLISION(body) => body.ser(version, bytes),
34889 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34890 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34891 Self::COMMAND_INT(body) => body.ser(version, bytes),
34892 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34893 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34894 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34895 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34896 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34897 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34898 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34899 Self::DATA_STREAM(body) => body.ser(version, bytes),
34900 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34901 Self::DEBUG(body) => body.ser(version, bytes),
34902 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34903 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34904 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34905 Self::EFI_STATUS(body) => body.ser(version, bytes),
34906 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34907 Self::ESC_INFO(body) => body.ser(version, bytes),
34908 Self::ESC_STATUS(body) => body.ser(version, bytes),
34909 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34910 Self::EVENT(body) => body.ser(version, bytes),
34911 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34912 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34913 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34914 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34915 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34916 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34917 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34918 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34919 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34920 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34921 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34922 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34923 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34924 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34925 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34926 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34927 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34928 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34929 Self::GPS2_RAW(body) => body.ser(version, bytes),
34930 Self::GPS2_RTK(body) => body.ser(version, bytes),
34931 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34932 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34933 Self::GPS_INPUT(body) => body.ser(version, bytes),
34934 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34935 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34936 Self::GPS_RTK(body) => body.ser(version, bytes),
34937 Self::GPS_STATUS(body) => body.ser(version, bytes),
34938 Self::HEARTBEAT(body) => body.ser(version, bytes),
34939 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34940 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34941 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34942 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34943 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34944 Self::HIL_GPS(body) => body.ser(version, bytes),
34945 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34946 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34947 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34948 Self::HIL_STATE(body) => body.ser(version, bytes),
34949 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34950 Self::HOME_POSITION(body) => body.ser(version, bytes),
34951 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34952 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34953 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34954 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34955 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34956 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34957 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34958 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34959 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34960 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34961 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34962 Self::LOG_DATA(body) => body.ser(version, bytes),
34963 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34964 Self::LOG_ERASE(body) => body.ser(version, bytes),
34965 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34966 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34967 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34968 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34969 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34970 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34971 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34972 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34973 Self::MISSION_ACK(body) => body.ser(version, bytes),
34974 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34975 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34976 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34977 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34978 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34979 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34980 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34981 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34982 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34983 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34984 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34985 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34986 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34987 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34988 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34989 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34990 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34991 Self::ODOMETRY(body) => body.ser(version, bytes),
34992 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34993 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34994 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34995 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34996 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34997 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34998 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34999 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35000 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35001 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35002 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35003 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35004 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35005 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35006 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35007 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35008 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35009 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35010 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35011 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35012 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35013 Self::PARAM_SET(body) => body.ser(version, bytes),
35014 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35015 Self::PING(body) => body.ser(version, bytes),
35016 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35017 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35018 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35019 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35020 Self::POWER_STATUS(body) => body.ser(version, bytes),
35021 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35022 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35023 Self::RAW_IMU(body) => body.ser(version, bytes),
35024 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35025 Self::RAW_RPM(body) => body.ser(version, bytes),
35026 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35027 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35028 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35029 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35030 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35031 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35032 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35033 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35034 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35035 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35036 Self::SCALED_IMU(body) => body.ser(version, bytes),
35037 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35038 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35039 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35040 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35041 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35042 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35043 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35044 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35045 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35046 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35047 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35048 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35049 Self::SET_MODE(body) => body.ser(version, bytes),
35050 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35051 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35052 Self::SIM_STATE(body) => body.ser(version, bytes),
35053 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35054 Self::STATUSTEXT(body) => body.ser(version, bytes),
35055 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35056 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35057 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35058 Self::SYS_STATUS(body) => body.ser(version, bytes),
35059 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35060 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35061 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35062 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35063 Self::TIMESYNC(body) => body.ser(version, bytes),
35064 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35065 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35066 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35067 Self::TUNNEL(body) => body.ser(version, bytes),
35068 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35069 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35070 Self::UAVIONIX_ADSB_GET(body) => body.ser(version, bytes),
35071 Self::UAVIONIX_ADSB_OUT_CFG(body) => body.ser(version, bytes),
35072 Self::UAVIONIX_ADSB_OUT_CFG_FLIGHTID(body) => body.ser(version, bytes),
35073 Self::UAVIONIX_ADSB_OUT_CFG_REGISTRATION(body) => body.ser(version, bytes),
35074 Self::UAVIONIX_ADSB_OUT_CONTROL(body) => body.ser(version, bytes),
35075 Self::UAVIONIX_ADSB_OUT_DYNAMIC(body) => body.ser(version, bytes),
35076 Self::UAVIONIX_ADSB_OUT_STATUS(body) => body.ser(version, bytes),
35077 Self::UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT(body) => body.ser(version, bytes),
35078 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35079 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35080 Self::VFR_HUD(body) => body.ser(version, bytes),
35081 Self::VIBRATION(body) => body.ser(version, bytes),
35082 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35083 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35084 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35085 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35086 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35087 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35088 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35089 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35090 Self::WIND_COV(body) => body.ser(version, bytes),
35091 }
35092 }
35093 fn extra_crc(id: u32) -> u8 {
35094 match id {
35095 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35096 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35097 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35098 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35099 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35100 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35101 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35102 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35103 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35104 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35105 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35106 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35107 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35108 }
35109 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35110 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35111 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35112 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35113 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35114 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35115 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35116 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35117 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35118 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35119 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35120 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35121 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35122 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35123 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35124 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35125 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35126 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35127 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35128 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35129 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35130 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35131 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35132 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35133 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35134 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35135 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35136 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35137 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35138 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35139 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35140 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35141 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35142 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35143 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35144 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35145 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35146 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35147 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35148 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35149 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35150 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35151 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35152 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35153 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35154 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35155 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35156 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35157 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35158 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35159 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35160 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35161 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35162 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35163 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35164 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35165 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35166 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35167 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35168 }
35169 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35170 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35171 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35172 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35173 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35174 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35175 }
35176 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35177 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35178 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35179 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35180 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35181 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35182 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35183 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35184 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35185 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35186 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35187 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35188 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35189 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35190 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35191 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35192 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35193 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35194 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35195 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35196 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35197 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35198 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35199 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35200 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35201 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35202 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35203 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35204 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35205 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35206 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35207 }
35208 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35209 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35210 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35211 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35212 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35213 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35214 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35215 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35216 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35217 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35218 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35219 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35220 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35221 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35222 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35223 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35224 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35225 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35226 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35227 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35228 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35229 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35230 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35231 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35232 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35233 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35234 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35235 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35236 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35237 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35238 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35239 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35240 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35241 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35242 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35243 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35244 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35245 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35246 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35247 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35248 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35249 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35250 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35251 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35252 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35253 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35254 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35255 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35256 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35257 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35258 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35259 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35260 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35261 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35262 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35263 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35264 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35265 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35266 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35267 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35268 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35269 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35270 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35271 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35272 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35273 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35274 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35275 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35276 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35277 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35278 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35279 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35280 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35281 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35282 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35283 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35284 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35285 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35286 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35287 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35288 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35289 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35290 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35291 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35292 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35293 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35294 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35295 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35296 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35297 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35298 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35299 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35300 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35301 }
35302 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35303 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35304 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35305 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35306 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35307 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35308 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35309 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35310 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35311 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35312 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35313 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35314 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35315 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35316 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35317 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35318 }
35319 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35320 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35321 }
35322 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35323 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35324 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35325 UAVIONIX_ADSB_GET_DATA::ID => UAVIONIX_ADSB_GET_DATA::EXTRA_CRC,
35326 UAVIONIX_ADSB_OUT_CFG_DATA::ID => UAVIONIX_ADSB_OUT_CFG_DATA::EXTRA_CRC,
35327 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::ID => {
35328 UAVIONIX_ADSB_OUT_CFG_FLIGHTID_DATA::EXTRA_CRC
35329 }
35330 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::ID => {
35331 UAVIONIX_ADSB_OUT_CFG_REGISTRATION_DATA::EXTRA_CRC
35332 }
35333 UAVIONIX_ADSB_OUT_CONTROL_DATA::ID => UAVIONIX_ADSB_OUT_CONTROL_DATA::EXTRA_CRC,
35334 UAVIONIX_ADSB_OUT_DYNAMIC_DATA::ID => UAVIONIX_ADSB_OUT_DYNAMIC_DATA::EXTRA_CRC,
35335 UAVIONIX_ADSB_OUT_STATUS_DATA::ID => UAVIONIX_ADSB_OUT_STATUS_DATA::EXTRA_CRC,
35336 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::ID => {
35337 UAVIONIX_ADSB_TRANSCEIVER_HEALTH_REPORT_DATA::EXTRA_CRC
35338 }
35339 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35340 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35341 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35342 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35343 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35344 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35345 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35346 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35347 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35348 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35349 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35350 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35351 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35352 _ => 0,
35353 }
35354 }
35355 fn target_system_id(&self) -> Option<u8> {
35356 match self {
35357 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35358 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35359 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35360 Self::CAN_FRAME(inner) => Some(inner.target_system),
35361 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35362 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35363 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35364 Self::COMMAND_INT(inner) => Some(inner.target_system),
35365 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35366 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35367 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35368 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35369 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35370 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35371 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35372 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35373 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35374 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35375 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35376 Self::LOG_ERASE(inner) => Some(inner.target_system),
35377 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35378 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35379 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35380 Self::MISSION_ACK(inner) => Some(inner.target_system),
35381 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35382 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35383 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35384 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35385 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35386 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35387 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35388 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35389 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35390 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35391 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35392 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35393 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35394 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35395 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35396 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35397 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35398 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35399 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35400 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35401 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35402 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35403 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35404 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35405 Self::PARAM_SET(inner) => Some(inner.target_system),
35406 Self::PING(inner) => Some(inner.target_system),
35407 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35408 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35409 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35410 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35411 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35412 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35413 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35414 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
35415 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
35416 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
35417 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
35418 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
35419 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
35420 Self::SET_MODE(inner) => Some(inner.target_system),
35421 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
35422 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
35423 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
35424 Self::TIMESYNC(inner) => Some(inner.target_system),
35425 Self::TUNNEL(inner) => Some(inner.target_system),
35426 Self::V2_EXTENSION(inner) => Some(inner.target_system),
35427 _ => None,
35428 }
35429 }
35430 fn target_component_id(&self) -> Option<u8> {
35431 match self {
35432 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
35433 Self::CANFD_FRAME(inner) => Some(inner.target_component),
35434 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
35435 Self::CAN_FRAME(inner) => Some(inner.target_component),
35436 Self::COMMAND_ACK(inner) => Some(inner.target_component),
35437 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
35438 Self::COMMAND_INT(inner) => Some(inner.target_component),
35439 Self::COMMAND_LONG(inner) => Some(inner.target_component),
35440 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
35441 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
35442 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
35443 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
35444 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
35445 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
35446 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
35447 Self::LOGGING_ACK(inner) => Some(inner.target_component),
35448 Self::LOGGING_DATA(inner) => Some(inner.target_component),
35449 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
35450 Self::LOG_ERASE(inner) => Some(inner.target_component),
35451 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
35452 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
35453 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
35454 Self::MISSION_ACK(inner) => Some(inner.target_component),
35455 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
35456 Self::MISSION_COUNT(inner) => Some(inner.target_component),
35457 Self::MISSION_ITEM(inner) => Some(inner.target_component),
35458 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
35459 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
35460 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
35461 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
35462 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
35463 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
35464 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
35465 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
35466 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
35467 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
35468 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
35469 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
35470 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
35471 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
35472 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
35473 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
35474 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
35475 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
35476 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
35477 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
35478 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
35479 Self::PARAM_SET(inner) => Some(inner.target_component),
35480 Self::PING(inner) => Some(inner.target_component),
35481 Self::PLAY_TUNE(inner) => Some(inner.target_component),
35482 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
35483 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
35484 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
35485 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
35486 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
35487 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
35488 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
35489 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
35490 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
35491 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
35492 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
35493 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
35494 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
35495 Self::TIMESYNC(inner) => Some(inner.target_component),
35496 Self::TUNNEL(inner) => Some(inner.target_component),
35497 Self::V2_EXTENSION(inner) => Some(inner.target_component),
35498 _ => None,
35499 }
35500 }
35501}